androidx.xr.glimmer.stack

Interfaces

StackItemScope

Receiver scope used by item content in VerticalStack.

StackScope

Receiver scope used by VerticalStack that defines a DSL for adding items to the stack.

Classes

StackState

The VerticalStack state that allows programmatic control and observation of the stack's state.

Composables

VerticalStack

VerticalStack is a lazy, vertically scrollable layout that arranges its items in a visually overlapping, three-dimensional sequence, which resembles a deck of cards.

rememberStackState

Creates and remembers a StackState for a VerticalStack.

Extension functions summary

inline Unit
<T : Any?> StackScope.items(
    items: List<T>,
    noinline key: ((item) -> Any)?,
    crossinline itemContent: @Composable StackItemScope.(item) -> Unit
)

Adds a list of items.

Extension functions

StackScope.items

inline fun <T : Any?> StackScope.items(
    items: List<T>,
    noinline key: ((item) -> Any)? = null,
    crossinline itemContent: @Composable StackItemScope.(item) -> Unit
): Unit

Adds a list of items.

Parameters
items: List<T>

the list of item data

noinline key: ((item) -> Any)? = null

a factory of stable and unique keys representing the items. If a key is specified, the scroll position will be maintained based on the key. If items are added/removed before the current visible item, the item with the given key will be kept as the first visible one. If null is passed, the position in the stack will represent the key.

crossinline itemContent: @Composable StackItemScope.(item) -> Unit

the content displayed by a single item