SpatialRowScope

@LayoutScopeMarker
interface SpatialRowScope


Scope for customizing the layout of children within a SpatialRow.

Summary

Public functions

SubspaceModifier

Aligns the element depthwise within the SpatialRow, overriding the row's default depth alignment.

SubspaceModifier

Aligns the element vertically within the SpatialRow, overriding the row's default vertical alignment.

SubspaceModifier
SubspaceModifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    fill: Boolean
)

Sizes the element's width proportionally to its weight relative to other weighted sibling elements in the SpatialRow.

Public functions

fun SubspaceModifier.align(alignment: SpatialAlignment.Depth): SubspaceModifier

Aligns the element depthwise within the SpatialRow, overriding the row's default depth alignment.

Parameters
alignment: SpatialAlignment.Depth

The depth alignment to apply.

Returns
SubspaceModifier

The modified SubspaceModifier.

fun SubspaceModifier.align(alignment: SpatialAlignment.Vertical): SubspaceModifier

Aligns the element vertically within the SpatialRow, overriding the row's default vertical alignment.

Parameters
alignment: SpatialAlignment.Vertical

The vertical alignment to apply.

Returns
SubspaceModifier

The modified SubspaceModifier.

fun SubspaceModifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float,
    fill: Boolean = true
): SubspaceModifier

Sizes the element's width proportionally to its weight relative to other weighted sibling elements in the SpatialRow.

The parent divides the remaining horizontal space after measuring unweighted children and distributes it according to the weights.

If fill is true, the element will occupy its entire allocated width. Otherwise, it can be smaller, potentially making the SpatialRow smaller as unused space isn't redistributed.

Parameters
weight: @FloatRange(from = 0.0, fromInclusive = false) Float

The proportional width for this element relative to other weighted siblings. Must be positive.

fill: Boolean = true

Whether the element should fill its entire allocated width.

Returns
SubspaceModifier

The modified SubspaceModifier.