WearableLinearLayoutManager

public class WearableLinearLayoutManager extends RecyclerView.LayoutManager, LinearLayoutManager implements ItemTouchHelper.ViewDropHandler, RecyclerView.SmoothScroller.ScrollVectorProvider


This wear-specific implementation of LinearLayoutManager provides basic offsetting logic for updating child layout. For round devices it offsets the children horizontally to make them appear to travel around a circle. For square devices it aligns them in a straight list. This functionality is provided by the CurvingLayoutCallback which is set when constructing the this class with its default constructor WearableLinearLayoutManager.

Summary

Nested types

WearableLinearLayoutManager.LayoutCallback

Callback for interacting with layout passes.

Public constructors

Creates a WearableLinearLayoutManager for a vertical list.

Creates a WearableLinearLayoutManager for a vertical list.

Public methods

@Nullable WearableLinearLayoutManager.LayoutCallback
@Override void

Lay out all relevant child views from the given adapter.

@Override int
scrollVerticallyBy(
    int dy,
    RecyclerView.Recycler recycler,
    RecyclerView.State state
)

Scroll vertically by dy pixels in screen coordinates and return the distance traveled.

void

Set a particular instance of the layout callback for this WearableLinearLayoutManager.

Inherited methods

From class LinearLayoutManager
@Override void

Checks if RecyclerView is in the middle of a layout or scroll and throws an IllegalStateException if it is.

@Override boolean
@Override boolean
@Override void
collectAdjacentPrefetchPositions(
    int dx,
    int dy,
    RecyclerView.State state,
    RecyclerView.LayoutManager.LayoutPrefetchRegistry layoutPrefetchRegistry
)

Gather all positions from the LayoutManager to be prefetched, given specified momentum.

@Override void
collectInitialPrefetchPositions(
    int adapterItemCount,
    RecyclerView.LayoutManager.LayoutPrefetchRegistry layoutPrefetchRegistry
)

Gather all positions from the LayoutManager to be prefetched in preperation for its RecyclerView to come on screen, due to the movement of another, containing RecyclerView.

@Override int

Override this method if you want to support scroll bars.

@Override int

Override this method if you want to support scroll bars.

@Override int

Override this method if you want to support scroll bars.

@Override PointF
computeScrollVectorForPosition(int targetPosition)

Should calculate the vector that points to the direction where the target position can be found.

@Override int

Override this method if you want to support scroll bars.

@Override int

Override this method if you want to support scroll bars.

@Override int

Override this method if you want to support scroll bars.

int

Returns the adapter position of the first fully visible view.

int

Returns the adapter position of the first visible view.

int

Returns the adapter position of the last fully visible view.

int

Returns the adapter position of the last visible view.

@Override View
findViewByPosition(int position)

Finds the view which represents the given adapter position.

@Override RecyclerView.LayoutParams

Create a default LayoutParams object for a child of the RecyclerView.

int