Register now for Android Dev Summit 2019!

WearableLinearLayoutManager

open class WearableLinearLayoutManager : LinearLayoutManager
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.LayoutManager
   ↳ androidx.recyclerview.widget.LinearLayoutManager
   ↳ androidx.wear.widget.WearableLinearLayoutManager

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(Context).

Summary

Nested classes

abstract

Callback for interacting with layout passes.

Inherited constants

Public constructors

Creates a WearableLinearLayoutManager for a vertical list.

<init>(context: Context!)

Creates a WearableLinearLayoutManager for a vertical list.

Public methods

open WearableLinearLayoutManager.LayoutCallback?

open Unit

open Int

open Unit

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

Inherited functions

Public constructors

<init>

WearableLinearLayoutManager(context: Context!, layoutCallback: WearableLinearLayoutManager.LayoutCallback!)

Creates a WearableLinearLayoutManager for a vertical list.

Parameters
context Context!: Current context, will be used to access resources.
layoutCallback Context!: Callback to be associated with this WearableLinearLayoutManager

<init>

WearableLinearLayoutManager(context: Context!)

Creates a WearableLinearLayoutManager for a vertical list.

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

Public methods

getLayoutCallback

@Nullable open fun getLayoutCallback(): WearableLinearLayoutManager.LayoutCallback?
Return
WearableLinearLayoutManager.LayoutCallback?: the current LayoutCallback associated with this WearableLinearLayoutManager.

onLayoutChildren

open fun onLayoutChildren(recycler: RecyclerView.Recycler!, state: RecyclerView.State!): Unit

scrollVerticallyBy

open fun scrollVerticallyBy(dy: Int, recycler: RecyclerView.Recycler!, state: RecyclerView.State!): Int

setLayoutCallback

open fun setLayoutCallback(@Nullable layoutCallback: WearableLinearLayoutManager.LayoutCallback?): Unit

Set a particular instance of the layout callback for this WearableLinearLayoutManager. The callback will be called on the Ui thread.

Parameters
layoutCallback WearableLinearLayoutManager.LayoutCallback?: