← Back to Foundation
LazyLayout
Component
in
Foundation
. Since 1.2.0Overview
Examples
Community Notes
A layout that only composes and lays out currently needed items. Can be used to build efficient scrollable layouts.
@param itemProvider provides all the needed info about the items which could be used to compose and measure items as part of measurePolicy. @param modifier to apply on the layout @param prefetchState allows to schedule items for prefetching @param measurePolicy Measure policy which allows to only compose and measure needed items.
Overloads
LazyLayout
@Deprecated(
message = "Use an overload accepting a lambda prodicing an item provider instead",
replaceWith = ReplaceWith(
"LazyLayout({ itemProvider }, modifier, prefetchState, measurePolicy)"
)
)
@ExperimentalFoundationApi
@Composable
fun LazyLayout(
itemProvider: LazyLayoutItemProvider,
modifier: Modifier = Modifier,
prefetchState: LazyLayoutPrefetchState? = null,
measurePolicy: LazyLayoutMeasureScope.(Constraints) -> MeasureResult
)
Parameters
Name | Description |
---|---|
itemProvider | provides all the needed info about the items which could be used to compose and measure items as part of measurePolicy. |
modifier | to apply on the layout |
prefetchState | allows to schedule items for prefetching |
measurePolicy | Measure policy which allows to only compose and measure needed items |
LazyLayout
@ExperimentalFoundationApi
@Composable
fun LazyLayout(
itemProvider: () -> LazyLayoutItemProvider,
modifier: Modifier = Modifier,
prefetchState: LazyLayoutPrefetchState? = null,
measurePolicy: LazyLayoutMeasureScope.(Constraints) -> MeasureResult
)
Parameters
Name | Description |
---|---|
itemProvider | lambda producing an item provider containing all the needed info about the items which could be used to compose and measure items as part of measurePolicy. |
modifier | to apply on the layout |
prefetchState | allows to schedule items for prefetching |
measurePolicy | Measure policy which allows to only compose and measure needed items. Note: this function is a part of LazyLayout harness that allows for building custom lazy layouts. LazyLayout and all corresponding APIs are still under development and are subject to change |
Previous Component← LazyHorizontalStaggeredGrid
Next ComponentLazyLayoutItemProvider →