← Compose Multiplatform Component in Compose Foundation
LazyLayout
Common
A layout that only composes and lays out currently needed items. Can be used to build efficient scrollable layouts.
Last updated:
Installation
dependencies {
implementation("androidx.compose.foundation:foundation:1.7.0-beta04")
}
Overloads
@Composable
@ExperimentalFoundationApi
@Deprecated(
message = "Use an overload accepting a lambda prodicing an item provider instead",
replaceWith = ReplaceWith(
"LazyLayout({ itemProvider }, modifier, prefetchState, measurePolicy)"
)
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. |
@Composable
@ExperimentalFoundationApi
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. |