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 android.support.wear.widget.WearableRecyclerView provided by the Android Support Library Wear module instead.

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

Summary

Nested classes

class WearableRecyclerView.ChildLayoutManager

Abstract class extending a LinearLayoutManager for defining the logic for updating layouts of children in a WearableRecyclerView

class WearableRecyclerView.OffsettingHelper

This class is deprecated. use WearableRecyclerView.ChildLayoutManager instead.  

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)

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

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

WearableRecyclerView (Context context)

Parameters
context Context

WearableRecyclerView

WearableRecyclerView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

WearableRecyclerView

WearableRecyclerView (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

clearOffsettingHelper

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

float getBezelWidth ()

Returns the current bezel width for circular scrolling.

Returns
float

getCenterEdgeItems

boolean getCenterEdgeItems ()

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

Returns
boolean

getOffsettingHelper

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

float getScrollDegreesPerScreen ()

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

Returns
float

isCircularScrollingGestureEnabled

boolean isCircularScrollingGestureEnabled ()

Returns whether circular scrolling is enabled for this view.

Returns
boolean

onGenericMotionEvent

boolean onGenericMotionEvent (MotionEvent ev)

Parameters
ev MotionEvent

Returns
boolean

onTouchEvent

boolean onTouchEvent (MotionEvent event)

Parameters
event MotionEvent

Returns
boolean

setBezelWidth

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

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

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

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

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

void onAttachedToWindow ()

onDetachedFromWindow

void onDetachedFromWindow ()