🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

LazyLayoutMeasureScope

The receiver scope of a LazyLayout's measure lambda.

Source set: Common
public sealed interface LazyLayoutMeasureScope : MeasureScope

The receiver scope of a LazyLayout's measure lambda. The return value of the measure lambda is MeasureResult, which should be returned by layout.

Call compose to compose items emitted in a content block for a given index.

Functions

compose

Source set: Common
public fun compose(@AndroidXIntRange(from = 0) index: Int): List<Measurable>

Compose an item of lazy layout.

Parameters

index the item index. Should be no larger that LazyLayoutItemProvider.itemCount.

Return

List of Measurables. Note that if you emitted multiple children into the item composable you will receive multiple measurebles.

measure

Source set: Common
@Deprecated(
        "Please use compose and call Measurable.measure",
        ReplaceWith("compose(index).map { it.measure(constraints) }"),
    )
    public fun measure(index: Int, constraints: Constraints): List<Placeable>

Subcompose and measure the item of lazy layout.

Parameters

index the item index. Should be no larger that LazyLayoutItemProvider.itemCount.
constraints Constraints to measure the children emitted into an item content composable specified via LazyLayoutItemProvider.Item.

Return

List of Placeables. Note that if you emitted multiple children into the item composable you will receive multiple placeables, each of them will be measured with the passed constraints.