added in version 26.1.0
belongs to Maven artifact com.android.support:wear:28.0.0-alpha1

WearableRecyclerView

public class WearableRecyclerView
extends RecyclerView

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


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

Summary

Inherited XML attributes

From class android.support.v7.widget.RecyclerView

Inherited constants

From class android.support.v7.widget.RecyclerView
From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

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

Public methods

float getBezelFraction()

Returns the current bezel width for circular scrolling as a fraction of the screen's radius.

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 isEdgeItemsCenteringEnabled()

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

boolean onTouchEvent(MotionEvent event)
void setBezelFraction(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 setCircularScrollingGestureEnabled(boolean circularScrollingGestureEnabled)

Enables/disables circular touch scrolling for this view.

void setEdgeItemsCenteringEnabled(boolean isEnabled)

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

void setScrollDegreesPerScreen(float degreesPerScreen)

Sets how many degrees the user has to rotate by to scroll through one screen height when they are using the circular scrolling gesture.The default value equates 180 degrees scroll to one screen.

Protected methods

void onAttachedToWindow()
void onDetachedFromWindow()

Inherited methods

From class android.support.v7.widget.RecyclerView
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.support.v4.view.ScrollingView
From interface android.support.v4.view.NestedScrollingChild2
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource
From interface android.support.v4.view.NestedScrollingChild

Public constructors

WearableRecyclerView

added in version 26.1.0
WearableRecyclerView (Context context)

Parameters
context Context

WearableRecyclerView

added in version 26.1.0
WearableRecyclerView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

WearableRecyclerView

added in version 26.1.0
WearableRecyclerView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

WearableRecyclerView

added in version 26.1.0
WearableRecyclerView (Context context, 
                AttributeSet attrs, 
                int defStyle, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyle int

defStyleRes int

Public methods

getBezelFraction

added in version 26.1.0
float getBezelFraction ()

Returns the current bezel width for circular scrolling as a fraction of the screen's radius.

Returns
float

getScrollDegreesPerScreen

added in version 26.1.0
float getScrollDegreesPerScreen ()

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

Returns
float

isCircularScrollingGestureEnabled

added in version 26.1.0
boolean isCircularScrollingGestureEnabled ()

Returns whether circular scrolling is enabled for this view.

Returns
boolean

isEdgeItemsCenteringEnabled

added in version 26.1.0
boolean isEdgeItemsCenteringEnabled ()

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

Returns
boolean

onTouchEvent

boolean onTouchEvent (MotionEvent event)

Parameters
event MotionEvent

Returns
boolean

setBezelFraction

added in version 26.1.0
void setBezelFraction (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. The default is the whole screen i.e 1.0f.

Parameters
fraction float

setCircularScrollingGestureEnabled

added in version 26.1.0
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. Related methods let you specify the characteristics of the scrolling, like the speed of the scroll or the are considered for the start of this scrolling gesture.

Parameters
circularScrollingGestureEnabled boolean

setEdgeItemsCenteringEnabled

added in version 26.1.0
void setEdgeItemsCenteringEnabled (boolean isEnabled)

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
isEnabled boolean: set to true if you wish to align the edge children (first and last) with the center of the screen.

setScrollDegreesPerScreen

added in version 26.1.0
void setScrollDegreesPerScreen (float degreesPerScreen)

Sets how many degrees the user has to rotate by to scroll through one screen height when they are using the circular scrolling gesture.The default value equates 180 degrees scroll to one screen.

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

Protected methods

onAttachedToWindow

void onAttachedToWindow ()

onDetachedFromWindow

void onDetachedFromWindow ()