Interface

LazyLayoutMeasureScope

The receiver scope of a LazyLayout's measure lambda.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Source set: Common

Added in 1.11.0-rc01

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

Added in 1.11.0-rc01

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.

Returns

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

measure

Added in 1.11.0-rc01

Deprecated in 1.11.0-rc01

@ExperimentalFoundationApi
    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.

Returns

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.