Start native apps faster with the Composables CLI ->
Object

SpatialArrangement.Absolute

Used to specify arrangement which doesn't change with layout direction.

Source set: Android
public object Absolute

Used to specify arrangement which doesn't change with layout direction.

Properties

Left

Source set: Android
public val Left: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeLeftOrTop(size = sizes, outPosition = outPositions, reverseInput = false)
                }

                override fun toString() = "SpatialAbsoluteArrangement#Left"
            }

All children should be arranged at the left of the androidx.xr.compose.subspace.SpatialRow. Unlike SpatialArrangement.Start, when layout direction is RTL, children will not be mirrored. Visually: 123####

Center

Source set: Android
public val Center: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeCenter(
                        totalSize = totalSize,
                        size = sizes,
                        outPosition = outPositions,
                        reverseInput = false,
                    )
                }

                override fun toString() = "SpatialAbsoluteArrangement#Center"
            }

All children should be arranged at the center of the androidx.xr.compose.subspace.SpatialRow. Unlike SpatialArrangement.Center, when layout direction is RTL, children will not be mirrored. Visually: ##123##

Right

Source set: Android
public val Right: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeRightOrBottom(
                        totalSize = totalSize,
                        size = sizes,
                        outPosition = outPositions,
                        reverseInput = false,
                    )
                }

                override fun toString() = "SpatialAbsoluteArrangement#Right"
            }

All children should be arranged at the right of the androidx.xr.compose.subspace.SpatialRow. Unlike SpatialArrangement.End, when layout direction is RTL, children will not be mirrored. Visually: ####123

SpaceEvenly

Source set: Android
public val SpaceEvenly: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeSpaceEvenly(
                        totalSize = totalSize,
                        size = sizes,
                        outPosition = outPositions,
                        reverseInput = false,
                    )
                }

                override fun toString() = "SpatialAbsoluteArrangement#SpaceEvenly"
            }

There should be equal space between the children and before the first child and after the last child. Unlike SpatialArrangement.SpaceEvenly, when layout direction is RTL, children will not be mirrored. Visually: #1#2#3#

SpaceBetween

Source set: Android
public val SpaceBetween: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeSpaceBetween(
                        totalSize = totalSize,
                        size = sizes,
                        outPosition = outPositions,
                        reverseInput = false,
                    )
                }

                override fun toString() = "SpatialAbsoluteArrangement#SpaceBetween"
            }

There should be equal space between the children and no space before the first child or after the last child. Unlike SpatialArrangement.SpaceBetween, when layout direction is RTL, children will not be mirrored. Visually: 1##2##3

SpaceAround

Source set: Android
public val SpaceAround: Horizontal =
            object : Horizontal {
                override fun Density.arrange(
                    totalSize: Int,
                    sizes: IntArray,
                    layoutDirection: LayoutDirection,
                    outPositions: IntArray,
                ) {
                    placeSpaceAround(
                        totalSize = totalSize,
                        size = sizes,
                        outPosition = outPositions,
                        reverseInput = false,
                    )
                }

                override fun toString() = "SpatialAbsoluteArrangement#SpaceAround"
            }

There should be equal space around each child. Unlike SpatialArrangement.SpaceAround, when layout direction is RTL, children will not be mirrored. Visually: #1##2##3##4#

Functions

spacedBy

Source set: Android
public fun spacedBy(space: Dp, spatialAlignment: SpatialAlignment.Horizontal): Horizontal

Children are placed next to each other with fixed space between them horizontally and align them according to the spatialAlignment given. Unlike SpatialArrangement.spacedBy, when layout direction is RTL, children will not be mirrored.

Parameters

space fixed space Dp to place between adjacent children.
spatialAlignment SpatialAlignment.Horizontal to align the children with.

aligned

Source set: Android
public fun aligned(spatialAlignment: SpatialAlignment.Horizontal): Horizontal

Children placed next to each other horizontally and align them according to the spatialAlignment given. Unlike SpatialArrangement.spacedBy, when layout direction is RTL, children will not be mirrored.

Parameters

spatialAlignment SpatialAlignment.Horizontal to align the children with.