LazyColumn

@Composable
fun LazyColumn(placeholder: @Composable () -> Unit, modifier: Modifier = Modifier, state: LazyListState = rememberLazyListState(), width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, content: LazyListScope.() -> Unit)

The vertically scrolling list that only composes and lays out the currently visible items. The content block defines a DSL which allows you to emit items of different types. For example you can use LazyListScope.item to add a single item and LazyListScope.items to add a list of items.

The purpose of placeholder is to define the temporary content of an on-screen item while the content of that item (as described by the content block) is being retrieved. When the content of that item has been retrieved, the placeholder is replaced with that of the content.

Parameters

state

The state object to be used to control or observe the list's state.

width

Sets whether the row's width will wrap its contents (Constraint.Wrap) or match the width of its parent (Constraint.Fill).

height

Sets whether the row's height will wrap its contents (Constraint.Wrap) or match the height of its parent (Constraint.Fill).

margin

Applies margin (space) around the list. This can also be applied to an individual item using Modifier.margin.

horizontalAlignment

The horizontal alignment applied to the items.

modifier

The modifier to apply to this layout.

placeholder

A block which describes the content of each placeholder item. Note that the placeholder block will be invoked multiple times, and assumes that the content and its sizing on each invocation is identical to one another.

content

A block which describes the content. Inside this block you can use methods like LazyListScope.item to add a single item or LazyListScope.items to add a list of items.


@Composable
fun LazyColumn(refreshing: Boolean, onRefresh: () -> Unit?, placeholder: @Composable () -> Unit, modifier: Modifier = Modifier, state: LazyListState = rememberLazyListState(), width: Constraint = Constraint.Wrap, height: Constraint = Constraint.Wrap, margin: Margin = Margin.Zero, horizontalAlignment: CrossAxisAlignment = CrossAxisAlignment.Start, pullRefreshContentColor: UInt, content: LazyListScope.() -> Unit)

The vertically scrolling list that only composes and lays out the currently visible items. The content block defines a DSL which allows you to emit items of different types. For example you can use LazyListScope.item to add a single item and LazyListScope.items to add a list of items.

This function differs from the other LazyColumn function, in that a refresh indicator is conditionally displayed via a vertical swipe gesture when at the beginning of the list. The appropriate response to this gesture can be supplied via the onRefresh callback.

The purpose of placeholder is to define the temporary content of an on-screen item while the content of that item (as described by the content block) is being retrieved. When the content of that item has been retrieved, the placeholder is replaced with that of the content.

Parameters

refreshing

Whether or not the list should show the pull-to-refresh indicator.

onRefresh

Called when a swipe gesture triggers a pull-to-refresh.

state

The state object to be used to control or observe the list's state.

width

Sets whether the row's width will wrap its contents (Constraint.Wrap) or match the width of its parent (Constraint.Fill).

height

Sets whether the row's height will wrap its contents (Constraint.Wrap) or match the height of its parent (Constraint.Fill).

margin

Applies margin (space) around the list. This can also be applied to an individual item using Modifier.margin.

horizontalAlignment

The horizontal alignment applied to the items.

pullRefreshContentColor

The color of the pull-to-refresh indicator as an ARGB color int. For example, the color 0xFF00AA00 would be a dark green with 100% opacity.

modifier

The modifier to apply to this layout.

placeholder

A block which describes the content of each placeholder item. Note that the placeholder block will be invoked multiple times, and assumes that the content and its sizing on each invocation is identical to one another.

content

A block which describes the content. Inside this block you can use methods like LazyListScope.item to add a single item or LazyListScope.items to add a list of items.