WearableRecyclerView

public class WearableRecyclerView extends RecyclerView implements ScrollingView, NestedScrollingChild, NestedScrollingChild2, NestedScrollingChild, NestedScrollingChild2, NestedScrollingChild3

Object
   ↳ RecyclerView
     ↳ WearableRecyclerView

Wearable specific implementation of the RecyclerView enabling circular scrolling} and semi-circular layouts.

See also
setCircularScrollingGestureEnabled

#setCircularScrollingGestureEnabled(boolean)

Summary

Public constructors

WearableRecyclerView(
    @NonNull Context context,
    @Nullable AttributeSet attrs
)
WearableRecyclerView(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyle
)
WearableRecyclerView(
    @NonNull Context context,
    @Nullable AttributeSet attrs,
    @NonNull int defStyle,
    @NonNull int defStyleRes
)

Public methods

@NonNull float

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

@NonNull float

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

@NonNull boolean

Returns whether circular scrolling is enabled for this view.

@NonNull boolean

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

@Override @NonNull boolean
@NonNull void
setBezelFraction(@NonNull 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.

@NonNull void
setCircularScrollingGestureEnabled(
    @NonNull boolean circularScrollingGestureEnabled
)

Enables/disables circular touch scrolling for this view.

@NonNull void

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

@NonNull void
setScrollDegreesPerScreen(@NonNull 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.

Inherited methods

From class NestedScrollingChild
abstract @NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @Nullable Array<@NonNull int> consumed,
    @Nullable Array<@NonNull int> offsetInWindow
)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

abstract @NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @Nullable Array<@NonNull int> offsetInWindow
)

Dispatch one step of a nested scroll in progress.

abstract @NonNull boolean

Begin a nestable scroll operation along the given axes.

From class NestedScrollingChild2
abstract @NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @Nullable Array<@NonNull int> consumed,
    @Nullable Array<@NonNull int> offsetInWindow,
    @ViewCompat.NestedScrollType @NonNull int type
)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

abstract @NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @Nullable Array<@NonNull int> offsetInWindow,
    @ViewCompat.NestedScrollType @NonNull int type
)

Dispatch one step of a nested scroll in progress.

abstract @NonNull boolean

Returns true if this view has a nested scrolling parent for the given input type.

abstract @NonNull boolean

Begin a nestable scroll operation along the given axes, for the given input type.

abstract @NonNull void

Stop a nested scroll in progress for the given input type.

From class NestedScrollingChild3
abstract @NonNull void
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @Nullable Array<@NonNull int> offsetInWindow,
    @ViewCompat.NestedScrollType @NonNull int type,
    @NonNull Array<@NonNull int> consumed
)

Dispatch one step of a nested scroll in progress.

From class RecyclerView
@Override @NonNull void
addFocusables(
    @NonNull ArrayList<@NonNull View> views,
    @NonNull int direction,
    @NonNull int focusableMode
)
@NonNull void

Add an ItemDecoration to this RecyclerView.

@NonNull void
addItemDecoration(
    @NonNull RecyclerView.ItemDecoration decor,
    @NonNull int index
)

Add an ItemDecoration to this RecyclerView.

@NonNull void

Register a listener that will be notified whenever a child view is attached to or detached from RecyclerView.

@NonNull void

Add an OnItemTouchListener to intercept touch events before they are dispatched to child views or this view's standard scrolling behavior.

@NonNull void

Add a listener that will be notified of any changes in scroll state or position.

@NonNull void

Register a listener that will be notified whenever a child view is recycled.

@NonNull void

Removes all listeners that were added via addOnChildAttachStateChangeListener.

@NonNull void

Remove all secondary listener that were notified of any changes in scroll state or position.

@Override @NonNull int

Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range.

@Override @NonNull int

Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range.

@Override @NonNull int

Compute the horizontal range that the horizontal scrollbar represents.

@Override @NonNull int

Compute the vertical extent of the vertical scrollbar's thumb within the vertical range.

@Override @NonNull int

Compute the vertical offset of the vertical scrollbar's thumb within the vertical range.

@Override @NonNull int

Compute the vertical range that the vertical scrollbar represents.

@Override @NonNull boolean
dispatchNestedFling(
    @NonNull float velocityX,
    @NonNull float velocityY,
    @NonNull boolean consumed
)
@Override @NonNull boolean
dispatchNestedPreFling(@NonNull float velocityX, @NonNull float velocityY)
@Override @NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@Override @NonNull boolean
dispatchNestedPreScroll(
    @NonNull int dx,
    @NonNull int dy,
    @NonNull Array<@NonNull int> consumed,
    @NonNull Array<@NonNull int> offsetInWindow,
    @NonNull int type
)

Dispatch one step of a nested scroll in progress before this view consumes any portion of it.

@Override @NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow
)
@Override @NonNull boolean
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow,
    @NonNull int type
)

Dispatch one step of a nested scroll in progress.

final @Override @NonNull void
dispatchNestedScroll(
    @NonNull int dxConsumed,
    @NonNull int dyConsumed,
    @NonNull int dxUnconsumed,
    @NonNull int dyUnconsumed,
    @NonNull Array<@NonNull int> offsetInWindow,
    @NonNull int type,
    @NonNull Array<@NonNull int> consumed
)

Dispatch one step of a nested scroll in progress.

@Override @NonNull boolean
@Override @NonNull void
@Override @NonNull boolean
drawChild(
    @NonNull Canvas canvas,
    @NonNull View child,
    @NonNull long drawingTime
)
@Nullable View
findChildViewUnder(@NonNull float x, @NonNull float y)

Find the topmost view under the given point.

@Nullable View

Traverses the ancestors of the given view and returns the item view that contains it and also a direct child of the RecyclerView.

@Nullable RecyclerView.ViewHolder

Returns the ViewHolder that contains the given view.

@Nullable RecyclerView.ViewHolder

Return the ViewHolder for the item in the given position of the data set.

@NonNull RecyclerView.ViewHolder