MeasurePolicy

fun interface MeasurePolicy


Defines the measure and layout behavior of a layout.

Based on androidx.compose.ui.layout.MeasurePolicy.

Summary

Public functions

MeasureResult
MeasureScope.measure(
    measurables: List<Measurable>,
    constraints: VolumeConstraints
)

The function that defines the measurement and layout.

Public functions

fun MeasureScope.measure(
    measurables: List<Measurable>,
    constraints: VolumeConstraints
): MeasureResult

The function that defines the measurement and layout. Each Measurable in the measurables list corresponds to a layout child of the layout, and children can be measured using the Measurable.measure method. This method takes the VolumeConstraints which the child should respect; different children can be measured with different constraints.

MeasureResult objects are usually created using the MeasureScope.layout factory, which takes the calculated size of this layout, its alignment lines, and a block defining the positioning of the children layouts.