WearableRecyclerView.ChildLayoutManager

public static abstract class WearableRecyclerView.ChildLayoutManager
extends LinearLayoutManager

java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.LayoutManager
     ↳ android.support.v7.widget.LinearLayoutManager
       ↳ android.support.wearable.view.WearableRecyclerView.ChildLayoutManager
Known Direct Subclasses


Abstract class extending a LinearLayoutManager for defining the logic for updating layouts of children in a WearableRecyclerView. Use this class if you wish to modify the appearance of a child based on their position in the WearableRecyclerView by overriding the abstract method updateChild(View, WearableRecyclerView). This method will be called on every layout pass of for the associated WearableRecyclerView. To associated this RecyclerView.LayoutManager with a WearableRecyclerView use the setLayoutManager(LayoutManager) methods.

Summary

Inherited constants

From class android.support.v7.widget.LinearLayoutManager

Public constructors

WearableRecyclerView.ChildLayoutManager(Context context)

Creates a WearableRecyclerView.ChildLayoutManager for a vertical list.

Public methods

void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state)
int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state)
abstract void updateChild(View child, WearableRecyclerView parent)

Override this method to implement custom child layout behavior on scroll.

Inherited methods

From class android.support.v7.widget.LinearLayoutManager
From class android.support.v7.widget.RecyclerView.LayoutManager
From class java.lang.Object
From interface android.support.v7.widget.helper.ItemTouchHelper.ViewDropHandler
From interface android.support.v7.widget.RecyclerView.SmoothScroller.ScrollVectorProvider

Public constructors

WearableRecyclerView.ChildLayoutManager

WearableRecyclerView.ChildLayoutManager (Context context)

Creates a WearableRecyclerView.ChildLayoutManager for a vertical list.

Parameters
context Context: Current context, will be used to access resources.

Public methods

onLayoutChildren

void onLayoutChildren (RecyclerView.Recycler recycler, 
                RecyclerView.State state)

Parameters
recycler RecyclerView.Recycler

state RecyclerView.State

scrollVerticallyBy

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

Parameters
dy int

recycler RecyclerView.Recycler

state RecyclerView.State

Returns
int

updateChild

void updateChild (View child, 
                WearableRecyclerView parent)

Override this method to implement custom child layout behavior on scroll. It is called at the end of each layout pass of the view and enables you to modify any property of the child view. Examples include scaling the children based on their distance from the center of the parent, or changing the translation of the children to create an ilusion of the path they are moving along.

Parameters
child View: the current child to be affected.

parent WearableRecyclerView: the WearableRecyclerView parent that this helper is attached to.