Skip to content

Most visited

Recently visited

navigation

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.

See also:

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.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)