WearableRecyclerView

public class WearableRecyclerView
extends RecyclerView

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.support.v7.widget.RecyclerView
         ↳ android.support.wearable.view.WearableRecyclerView


This class is deprecated.
use the androidx.wear.widget.WearableRecyclerView provided by the Jetpack Wear library instead.

Wearable specific implementation of the RecyclerView enabling setCircularScrollingGestureEnabled(boolean) circular scrolling} and semi-circular layouts.

Summary

Nested classes

class WearableRecyclerView.ChildLayoutManager

This class is deprecated. use the androidx.wear.widget.WearableRecyclerView provided by the Jetpack Wear library instead.  

class WearableRecyclerView.OffsettingHelper

This class is deprecated. use WearableRecyclerView.ChildLayoutManager instead.  

Inherited constants

Inherited fields

Public constructors

WearableRecyclerView(Context context)
WearableRecyclerView(Context context, AttributeSet attrs)
WearableRecyclerView(Context context, AttributeSet attrs, int defStyle)

Public methods

void clearOffsettingHelper()

This method is deprecated. use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

float getBezelWidth()

Returns the current bezel width for circular scrolling.

boolean getCenterEdgeItems()

Returns whether the view is currently configured to center the edge children.

WearableRecyclerView.OffsettingHelper getOffsettingHelper()

This method is deprecated. use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

float getScrollDegreesPerScreen()

Returns how many degrees does the user have to rotate for to scroll through one screen height.

boolean isCircularScrollingGestureEnabled()

Returns whether circular scrolling is enabled for this view.

boolean onGenericMotionEvent(MotionEvent ev)
boolean onTouchEvent(MotionEvent event)
void setBezelWidth(float fraction)

Taps within this radius and the radius of the screen are considered close enough to the bezel to be candidates for circular scrolling.

void setCenterEdgeItems(boolean centerEdgeItems)

Use this method to configure the WearableRecyclerView to always align the first and last items with the vertical center of the screen.

void setCircularScrollingGestureEnabled(boolean circularScrollingGestureEnabled)

Enables/disables circular touch scrolling for this view.

void setOffsettingHelper(WearableRecyclerView.OffsettingHelper offsettingHelper)

This method is deprecated. use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

void setScrollDegreesPerScreen(float degreesPerScreen)

Sets how many degrees the user has to rotate by to scroll through one screen height.

Protected methods

void onAttachedToWindow()
void onDetachedFromWindow()

Inherited methods

Public constructors

WearableRecyclerView

public WearableRecyclerView (Context context)

Parameters
context Context

WearableRecyclerView

public WearableRecyclerView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

WearableRecyclerView

public WearableRecyclerView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

clearOffsettingHelper

public void clearOffsettingHelper ()

This method is deprecated.
use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

Clears the associated WearableRecyclerView.OffsettingHelper. This is a convenience method equivalent to calling setOffsettingHelper(WearableRecyclerView.OffsettingHelper) with a null argument.

Calling this method will disable any offsetting of the launcher items, effectively aligning the WearableRecyclerView with a regular RecyclerView in terms of layout.

getBezelWidth

public float getBezelWidth ()

Returns the current bezel width for circular scrolling.

Returns
float

getCenterEdgeItems

public boolean getCenterEdgeItems ()

Returns whether the view is currently configured to center the edge children. See setCenterEdgeItems(boolean) for details.

Returns
boolean

getOffsettingHelper

public WearableRecyclerView.OffsettingHelper getOffsettingHelper ()

This method is deprecated.
use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

Return the WearableRecyclerView.OffsettingHelper currently responsible for offsetting logic for this WearableRecyclerView.

Returns
WearableRecyclerView.OffsettingHelper the currently used WearableRecyclerView.OffsettingHelper instance.

getScrollDegreesPerScreen

public float getScrollDegreesPerScreen ()

Returns how many degrees does the user have to rotate for to scroll through one screen height.

Returns
float

isCircularScrollingGestureEnabled

public boolean isCircularScrollingGestureEnabled ()

Returns whether circular scrolling is enabled for this view.

Returns
boolean

onGenericMotionEvent

public boolean onGenericMotionEvent (MotionEvent ev)

Parameters
ev MotionEvent

Returns
boolean

onTouchEvent

public boolean onTouchEvent (MotionEvent event)

Parameters
event MotionEvent

Returns
boolean

setBezelWidth

public void setBezelWidth (float fraction)

Taps within this radius and the radius of the screen are considered close enough to the bezel to be candidates for circular scrolling. Expressed as a fraction of the screen's radius.

Parameters
fraction float

setCenterEdgeItems

public void setCenterEdgeItems (boolean centerEdgeItems)

Use this method to configure the WearableRecyclerView to always align the first and last items with the vertical center of the screen. This effectively moves the start and end of the list to the middle of the screen if the user has scrolled so far. It takes the height of the children into account so that they are correctly centered.

Parameters
centerEdgeItems boolean: set to true if you wish to align the edge children (first and last) with the center of the screen.

setCircularScrollingGestureEnabled

public void setCircularScrollingGestureEnabled (boolean circularScrollingGestureEnabled)

Enables/disables circular touch scrolling for this view. When enabled, circular touch gestures around the edge of the screen will cause the view to scroll up or down.

Parameters
circularScrollingGestureEnabled boolean

setOffsettingHelper

public void setOffsettingHelper (WearableRecyclerView.OffsettingHelper offsettingHelper)

This method is deprecated.
use the WearableRecyclerView.ChildLayoutManager for similar functionality and a cleaner API.

Sets the WearableRecyclerView.OffsettingHelper that this WearableRecyclerView will use.

Parameters
offsettingHelper WearableRecyclerView.OffsettingHelper: the instance of WearableRecyclerView.OffsettingHelper to use. Pass null if you wish to clear the instance used.

setScrollDegreesPerScreen

public void setScrollDegreesPerScreen (float degreesPerScreen)

Sets how many degrees the user has to rotate by to scroll through one screen height.

Parameters
degreesPerScreen float: the number of degrees to rotate by to scroll through one whole height of the screen,

Protected methods

onAttachedToWindow

protected void onAttachedToWindow ()

onDetachedFromWindow

protected void onDetachedFromWindow ()