LazyColumnFor

inline fun <T> LazyColumnFor(items: Array<T>, modifier: Modifier = Modifier, noinline key: (item: T) -> Any? = null, noinline contentType: (item: T) -> Any? = { null }, state: LazyListState = rememberLazyListState(), contentPadding: PaddingValues = PaddingValues(0.dp), reverseLayout: Boolean = false, verticalArrangement: Arrangement.Vertical = if (!reverseLayout) Arrangement.Top else Arrangement.Bottom, horizontalAlignment: Alignment.Horizontal = Alignment.Start, flingBehavior: FlingBehavior = ScrollableDefaults.flingBehavior(), userScrollEnabled: Boolean = true, crossinline itemContent: @Composable LazyItemScope.(item: T) -> Unit)

The vertical scrolling list that only composes and lays out the currently visible items. This composable shows only Array of items.

Parameters

items

the data array

modifier

the modifier to apply to this layout

key

a factory of stable and unique keys representing the item. Using the same key for multiple items in the list is not allowed. The Type of key should be savable via Bundle on Android. If null is passed, the position in the list will represent the key. When you specify the key, the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item, the item with the given key will be kept as the first visible one

contentType

a factory of the content types for the item. The item compositions of the same type could be reused more efficiently. Note that null is a valid type and item of such a type will be considered compatible

state

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

contentPadding

a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. You can use it to add a padding before the first item or after the last one. If you want to add a spacing between each item use verticalArrangement

reverseLayout

reverse the direction of scrolling and layout. When true, items are laid out in the reverse order and LazyListState.firstVisibleItemIndex == 0 means that column is scrolled to the bottom. Note that reverseLayout does not change the behavior of verticalArrangement, e.g. with Arrangement.Top (top) 123### (bottom) becomes (top) 321### (bottom)

verticalArrangement

The vertical arrangement of the layout's children. This allows adding a spacing between items and specifying the arrangement of the items when we have not enough of them to fill the whole minimum size

horizontalAlignment

the horizontal alignment applied to the items

flingBehavior

logic describing fling behavior

userScrollEnabled

whether the scrolling via the user gestures or accessibility actions is allowed. You can still scroll programmatically, using the state even when it is disabled

itemContent

the content displayed by a single item


fun LazyColumnFor(count: Int, modifier: Modifier = Modifier, key: (index: Int) -> Any? = null, contentType: (index: Int) -> Any? = { null }, state: LazyListState = rememberLazyListState(), contentPadding: PaddingValues = PaddingValues(0.dp), reverseLayout: Boolean = false, verticalArrangement: Arrangement.Vertical = if (!reverseLayout) Arrangement.Top else Arrangement.Bottom, horizontalAlignment: Alignment.Horizontal = Alignment.Start, flingBehavior: FlingBehavior = ScrollableDefaults.flingBehavior(), userScrollEnabled: Boolean = true, itemContent: @Composable LazyItemScope.(index: Int) -> Unit)

The vertical scrolling list that only composes and lays out the currently visible items. This composable shows only List of items.

Parameters

count

items count

modifier

the modifier to apply to this layout

key

a factory of stable and unique keys representing the item. Using the same key for multiple items in the list is not allowed. The Type of key should be savable via Bundle on Android. If null is passed, the position in the list will represent the key. When you specify the key, the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item, the item with the given key will be kept as the first visible one

contentType

a factory of the content types for the item. The item compositions of the same type could be reused more efficiently. Note that null is a valid type and item of such a type will be considered compatible

state

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

contentPadding

a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. You can use it to add a padding before the first item or after the last one. If you want to add a spacing between each item use verticalArrangement

reverseLayout

reverse the direction of scrolling and layout. When true, items are laid out in the reverse order and LazyListState.firstVisibleItemIndex == 0 means that column is scrolled to the bottom. Note that reverseLayout does not change the behavior of verticalArrangement, e.g. with Arrangement.Top (top) 123### (bottom) becomes (top) 321### (bottom)

verticalArrangement

The vertical arrangement of the layout's children. This allows adding a spacing between items and specifying the arrangement of the items when we have not enough of them to fill the whole minimum size

horizontalAlignment

the horizontal alignment applied to the items

flingBehavior

logic describing fling behavior

userScrollEnabled

whether the scrolling via the user gestures or accessibility actions is allowed. You can still scroll programmatically, using the state even when it is disabled

itemContent

the content displayed by a single item


inline fun <T> LazyColumnFor(items: List<T>, modifier: Modifier = Modifier, noinline key: (item: T) -> Any? = null, noinline contentType: (item: T) -> Any? = { null }, state: LazyListState = rememberLazyListState(), contentPadding: PaddingValues = PaddingValues(0.dp), reverseLayout: Boolean = false, verticalArrangement: Arrangement.Vertical = if (!reverseLayout) Arrangement.Top else Arrangement.Bottom, horizontalAlignment: Alignment.Horizontal = Alignment.Start, flingBehavior: FlingBehavior = ScrollableDefaults.flingBehavior(), userScrollEnabled: Boolean = true, crossinline itemContent: @Composable LazyItemScope.(item: T) -> Unit)

The vertical scrolling list that only composes and lays out the currently visible items. This composable shows only List of items.

Parameters

items

the data list

modifier

the modifier to apply to this layout

key

a factory of stable and unique keys representing the item. Using the same key for multiple items in the list is not allowed. The Type of key should be savable via Bundle on Android. If null is passed, the position in the list will represent the key. When you specify the key, the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item, the item with the given key will be kept as the first visible one

contentType

a factory of the content types for the item. The item compositions of the same type could be reused more efficiently. Note that null is a valid type and item of such a type will be considered compatible

state

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

contentPadding

a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. You can use it to add a padding before the first item or after the last one. If you want to add a spacing between each item use verticalArrangement

reverseLayout

reverse the direction of scrolling and layout. When true, items are laid out in the reverse order and LazyListState.firstVisibleItemIndex == 0 means that column is scrolled to the bottom. Note that reverseLayout does not change the behavior of verticalArrangement, e.g. with Arrangement.Top (top) 123### (bottom) becomes (top) 321### (bottom)

verticalArrangement

The vertical arrangement of the layout's children. This allows adding a spacing between items and specifying the arrangement of the items when we have not enough of them to fill the whole minimum size

horizontalAlignment

the horizontal alignment applied to the items

flingBehavior

logic describing fling behavior

userScrollEnabled

whether the scrolling via the user gestures or accessibility actions is allowed. You can still scroll programmatically, using the state even when it is disabled

itemContent

the content displayed by a single item