Interface

SpatialRowScope

Scope for customizing the layout of children within a SpatialRow.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
@LayoutScopeMarker
public interface SpatialRowScope

Scope for customizing the layout of children within a SpatialRow.

Functions

weight

public fun SubspaceModifier.weight(
        @FloatRange(from = 0.0, fromInclusive = false) weight: 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 The proportional width for this element relative to other weighted siblings. Must be positive.
fill Whether the element should fill its entire allocated width.

Returns

The modified SubspaceModifier.

align

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

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

Parameters

alignment The vertical alignment to apply.

Returns

The modified SubspaceModifier.

align

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

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

Parameters

alignment The depth alignment to apply.

Returns

The modified SubspaceModifier.