Google is committed to advancing racial equity for Black communities. See how.

androidx.ui.foundation.lazy

Top-level functions summary

Unit
LazyColumnItems(items: List<T>, modifier: Modifier = Modifier, contentPadding: InnerPadding = InnerPadding(0.dp), itemContent: (T) -> Unit)

A vertically scrolling list that only composes and lays out the currently visible items.

Unit
LazyRowItems(items: List<T>, modifier: Modifier = Modifier, contentPadding: InnerPadding = InnerPadding(0.dp), itemContent: (T) -> Unit)

A horizontally scrolling list that only composes and lays out the currently visible items.

Top-level functions

LazyColumnItems

@Composable fun <T> LazyColumnItems(
    items: List<T>,
    modifier: Modifier = Modifier,
    contentPadding: InnerPadding = InnerPadding(0.dp),
    itemContent: (T) -> Unit
): Unit

A vertically scrolling list that only composes and lays out the currently visible items.

Parameters
items: List<T> the backing list of data to display
modifier: Modifier = Modifier the modifier to apply to this layout
contentPadding: InnerPadding = InnerPadding(0.dp) convenience param to specify 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. Note that it is not a padding applied for each item's content
itemContent: (T) -> Unit emits the UI for an item from items list. May emit any number of components, which will be stacked vertically. Note that LazyColumnItems can start scrolling incorrectly if you emit nothing and then lazily recompose with the real content, so even if you load the content asynchronously please reserve some space for the item, for example using Spacer.

LazyRowItems

@Composable fun <T> LazyRowItems(
    items: List<T>,
    modifier: Modifier = Modifier,
    contentPadding: InnerPadding = InnerPadding(0.dp),
    itemContent: (T) -> Unit
): Unit

A horizontally scrolling list that only composes and lays out the currently visible items.

Parameters
items: List<T> the backing list of data to display
modifier: Modifier = Modifier the modifier to apply to this layout
contentPadding: InnerPadding = InnerPadding(0.dp) convenience param to specify 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. Note that it is not a padding applied for each item's content
itemContent: (T) -> Unit emits the UI for an item from items list. May emit any number of components, which will be stacked horizontally. Note that LazyRowItems can start scrolling incorrectly if you emit nothing and then lazily recompose with the real content, so even if you load the content asynchronously please reserve some space for the item, for example using Spacer.