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 @NonNull void

Lay out all relevant child views from the given adapter.

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

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

@NonNull void

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

Inherited methods

From class LinearLayoutManager
@Override @NonNull void

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

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

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

@Override @NonNull void
collectInitialPrefetchPositions(
    @NonNull int adapterItemCount,
    @NonNull 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 @NonNull int

Override this method if you want to support scroll bars.

@Override @NonNull int

Override this method if you want to support scroll bars.

@Override @NonNull int

Override this method if you want to support scroll bars.

@Override @NonNull PointF

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

@Override @NonNull int

Override this method if you want to support scroll bars.

@Override @