RowColumnMeasurePolicy¶
abstract class RowColumnMeasurePolicy(
val sumWidth: Boolean = false,
val sumHeight: Boolean = false,
val arrangementSpacing: Int = 0
) : MeasurePolicy
Base MeasurePolicy for Row and Column layouts.
Handles sequential measurement (subtracting consumed space when sumWidth or sumHeight is true) and delegates child placement to placeChildren.
Parameters¶
-
sumWidth: When
true, each child's width is subtracted from the remaining max-width before the next child is measured (Row behaviour). -
sumHeight: When
true, each child's height is subtracted from the remaining max-height before the next child is measured (Column behaviour). -
arrangementSpacing: Additional pixels added between siblings by the arrangement.
Constructors¶
RowColumnMeasurePolicy¶
Parameters
-
sumWidth: When
true, each child's width is subtracted from the remaining max-width before the next child is measured (Row behaviour). -
sumHeight: When
true, each child's height is subtracted from the remaining max-height before the next child is measured (Column behaviour). -
arrangementSpacing: Additional pixels added between siblings by the arrangement.
Properties¶
arrangementSpacing¶
val arrangementSpacing: Int
Parameters
- arrangementSpacing: Additional pixels added between siblings by the arrangement.
sumHeight¶
Parameters
- sumHeight: When
true, each child's height is subtracted from the remaining max-height before the next child is measured (Column behaviour).
sumWidth¶
Parameters
- sumWidth: When
true, each child's width is subtracted from the remaining max-width before the next child is measured (Row behaviour).
Functions¶
measure¶
open override fun measure(
scope: MeasureScope,
measurables: List<Measurable>,
constraints: Constraints
): MeasureResult
Measures measurables within constraints and returns a MeasureResult.
Parameters
-
scope: The
LayoutNodecurrently being measured (implementsMeasureScope). -
measurables: The child nodes to measure.
-
constraints: The size constraints imposed by the parent.
placeChildren¶
abstract fun placeChildren(
scope: MeasureScope,
measurables: List<Measurable>,
placeables: List<Placeable>,
width: Int,
height: Int
): MeasureResult
Positions all measured placeables within width × height and returns the MeasureResult.
Parameters
-
scope: The measuring
LayoutNode. -
measurables: The original measurables (for modifier access).
-
placeables: The measured placeables to position.
-
width: The resolved container width.
-
height: The resolved container height.