MeasureScope

Receiver for LayoutFunction.measure, and where a pass leaves what it works out: it asks its children as IntrinsicMeasureScope does, measures them, and declares.

A layout function reports through the scope rather than by returning a value, so everything a pass produces arrives by one route and a later addition needs no new return type.

Properties

Link copied to clipboard

The direction the container is laid out in.

Functions

Link copied to clipboard
fun layout(width: Int, height: Int, placement: PlacementScope.() -> Unit)

Declare this container's size and how its children are positioned.

Link copied to clipboard
fun Measurable.measure(constraints: SizeConstraints): Placeable

Lay this child out under constraints and report the size it took.

Link copied to clipboard
fun Dimen.toPixels(): Int

This dimension in pixels, as the container's resources resolve it: 16.dp.toPixels().