{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LazyLayoutKt

public final class LazyLayoutKt


Summary

Public methods

static final void

A layout that only composes and lays out currently needed items.

Public methods

LazyLayout

@ExperimentalFoundationApi
@Composable
public static final void LazyLayout(
    @NonNull LazyLayoutItemProvider itemProvider,
    @NonNull Modifier modifier,
    LazyLayoutPrefetchState prefetchState,
    @ExtensionFunctionType @NonNull Function2<@NonNull LazyLayoutMeasureScope, @NonNull Constraints, @NonNull MeasureResult> measurePolicy
)

A layout that only composes and lays out currently needed items. Can be used to build efficient scrollable layouts.

Parameters
@NonNull LazyLayoutItemProvider itemProvider

provides all the needed info about the items which could be used to compose and measure items as part of measurePolicy.

@NonNull Modifier modifier

to apply on the layout

LazyLayoutPrefetchState prefetchState

allows to schedule items for prefetching

@ExtensionFunctionType @NonNull Function2<@NonNull LazyLayoutMeasureScope, @NonNull Constraints, @NonNull MeasureResult> measurePolicy

Measure policy which allows to only compose and measure needed items.