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


This class is deprecated.
use the androidx.wear.widget.WearableRecyclerView provided by the Jetpack Wear library instead.

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 RecyclerView.setLayoutManager(LayoutManager) methods.

Summary

Inherited constants

Public constructors

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

Public constructors

ChildLayoutManager

public 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

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

Parameters
recycler RecyclerView.Recycler

state RecyclerView.State

scrollVerticallyBy

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

Parameters
dy int

recycler RecyclerView.Recycler

state RecyclerView.State

Returns
int

updateChild

public abstract 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.