SubspaceMeasurable

interface SubspaceMeasurable


A part of the composition layout that can be measured.

Based on androidx.compose.ui.layout.Measurable.

Summary

Public functions

Unit

Adjusts layout with a new ParentLayoutParamsAdjustable.

SubspacePlaceable
measure(constraints: VolumeConstraints)

Measures the layout with VolumeConstraints, returning a SubspacePlaceable layout that has its new size.

Public functions

adjustParams

Added in 1.0.0-alpha05
fun adjustParams(params: ParentLayoutParamsAdjustable): Unit

Adjusts layout with a new ParentLayoutParamsAdjustable.

This is useful in implementations of SubspaceMeasurePolicy.measure to provide child measurables with the context objects they need to inform their parent of their layout preferences using ParentLayoutParamsModifier.adjustParams.

// Child composable modifiers can modify MyParams which can be read by the parent.
var myParams = MyParams().also { measurable.adjustParams(it) }

measure

Added in 1.0.0-alpha05
fun measure(constraints: VolumeConstraints): SubspacePlaceable

Measures the layout with VolumeConstraints, returning a SubspacePlaceable layout that has its new size.