LazyLayoutMeasureScope


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.

Summary

Public functions

List<Measurable>
compose(index: @IntRange(from = 0) Int)

Compose an item of lazy layout.

Cmn
List<Placeable>

This function is deprecated. Please use compose and call Measurable.measure

Cmn

Inherited functions

From androidx.compose.ui.unit.Density
open Int

Convert Dp to Int by rounding

Cmn
open Int

Convert Sp to Int by rounding

Cmn
open Dp

Convert an Int pixel value to Dp.

Cmn
open Dp

Convert a Float pixel value to a Dp

Cmn
open DpSize

Convert a Size to a DpSize.

Cmn
open Float

Convert Dp to pixels.

Cmn
open Float

Convert Sp to pixels.

Cmn
open Rect

Convert a DpRect to a Rect.

Cmn
open Size

Convert a DpSize to a Size.

Cmn
open TextUnit

Convert an Int pixel value to Sp.

Cmn
open TextUnit

Convert a Float pixel value to a Sp

Cmn
From androidx.compose.ui.unit.FontScaling
open Dp

Convert Sp to Dp.

Cmn
open TextUnit

Convert Dp to Sp.

Cmn
From androidx.compose.ui.layout.MeasureScope
open MeasureResult
layout(
    width: Int,
    height: Int,
    alignmentLines: Map<AlignmentLineInt>,
    placementBlock: Placeable.PlacementScope.() -> Unit
)

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic.

Cmn
open MeasureResult
layout(
    width: Int,
    height: Int,
    alignmentLines: Map<AlignmentLineInt>,
    rulers: (RulerScope.() -> Unit)?,
    placementBlock: Placeable.PlacementScope.() -> Unit
)

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic.

Cmn

Inherited properties

From androidx.compose.ui.unit.Density
Float

The logical density of the display.

Cmn
From androidx.compose.ui.unit.FontScaling
Float

Current user preference for the scaling factor for fonts.

Cmn
From androidx.compose.ui.layout.IntrinsicMeasureScope
open Boolean

This indicates whether the ongoing measurement is for lookahead pass.

Cmn
LayoutDirection

The LayoutDirection of the Layout or LayoutModifier using the measure scope to measure their children.

Cmn

Public functions

compose

fun compose(index: @IntRange(from = 0) Int): List<Measurable>

Compose an item of lazy layout.

Parameters
index: @IntRange(from = 0) Int

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

Returns
List<Measurable>

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

measure

@ExperimentalFoundationApi
fun measure(index: Int, constraints: Constraints): List<Placeable>

Subcompose and measure the item of lazy layout.

Parameters
index: Int

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

constraints: Constraints

Constraints to measure the children emitted into an item content composable specified via LazyLayoutItemProvider.Item.

Returns
List<Placeable>

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.