Skip to content

Most visited

Recently visited

navigation

CurvedChildLayoutManager

public class CurvedChildLayoutManager
extends WearableRecyclerView.ChildLayoutManager

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


This class is deprecated.
use the android.support.wear.widget.WearableRecyclerView and associated classes provided by the Android Support Library Wear module instead.

This implementation of WearableRecyclerView.ChildLayoutManager 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.

Summary

Inherited constants

From class android.support.v7.widget.LinearLayoutManager

Public constructors

CurvedChildLayoutManager(Context context)

Public methods

void adjustAnchorOffsetXY(View child, float[] anchorOffsetXY)

Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass.

void updateChild(View child, WearableRecyclerView parent)

The default implementation will lay out children along a curve for round screens and along a straight line for square screens.

Inherited methods

From class android.support.wearable.view.WearableRecyclerView.ChildLayoutManager
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

CurvedChildLayoutManager

CurvedChildLayoutManager (Context context)

Parameters
context Context

Public methods

adjustAnchorOffsetXY

void adjustAnchorOffsetXY (View child, 
                float[] anchorOffsetXY)

Override this method if you wish to adjust the anchor coordinates for each child view during a layout pass. In the override set the new desired anchor coordinates in the provided array. The coordinates should be provided in relation to the child view.

Parameters
child View: The child view to which the anchor coordinates will apply.

anchorOffsetXY float: The anchor coordinates for the provided child view, by default set to a pre-defined constant on the horizontal axis and half of the child height on the vertical axis (vertical center).

updateChild

void updateChild (View child, 
                WearableRecyclerView parent)

The default implementation will lay out children along a curve for round screens and along a straight line for square screens.

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)