{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

Arrangement.Absolute

public static class Arrangement.Absolute


Summary

Public fields

static @NonNull Arrangement.Absolute

Public methods

final @NonNull Arrangement.Horizontal

Place children horizontally one next to the other and align the obtained group according to an alignment.

final @NonNull Arrangement.Horizontal

Place children such that they are as close as possible to the middle of the Row.

final @NonNull Arrangement.Horizontal

Place children horizontally such that they are as close as possible to the left edge of the Row.

final @NonNull Arrangement.Horizontal

Place children horizontally such that they are as close as possible to the right edge of the Row.

final @NonNull Arrangement.Horizontal

Place children such that they are spaced evenly horizontally, including free space before the first child and after the last child, but half the amount of space existing otherwise between two consecutive children.

final @NonNull Arrangement.Horizontal

Place children such that they are spaced evenly across the main axis, without free space before the first child or after the last child.

final @NonNull Arrangement.Horizontal

Place children such that they are spaced evenly across the main axis, including free space before the first child and after the last child.

final @NonNull Arrangement.HorizontalOrVertical

Place children such that each two adjacent ones are spaced by a fixed space distance across the main axis.

final @NonNull Arrangement.Horizontal

Place children horizontally such that each two adjacent ones are spaced by a fixed space distance.

final @NonNull Arrangement.Vertical

Place children vertically such that each two adjacent ones are spaced by a fixed space distance.

Public fields

INSTANCE

public static @NonNull Arrangement.Absolute INSTANCE

Public methods

aligned

public final @NonNull Arrangement.Horizontal aligned(@NonNull Alignment.Horizontal alignment)

Place children horizontally one next to the other and align the obtained group according to an alignment.

Unlike Arrangement.aligned, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Parameters
@NonNull Alignment.Horizontal alignment

The alignment of the children inside the parent.

getCenter

public final @NonNull Arrangement.Horizontal getCenter()

Place children such that they are as close as possible to the middle of the Row.

Unlike Arrangement.Center, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: ##123##

getLeft

public final @NonNull Arrangement.Horizontal getLeft()

Place children horizontally such that they are as close as possible to the left edge of the Row.

Unlike Arrangement.Start, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: 123####

getRight

public final @NonNull Arrangement.Horizontal getRight()

Place children horizontally such that they are as close as possible to the right edge of the Row.

Unlike Arrangement.End, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: ####123

getSpaceAround

public final @NonNull Arrangement.Horizontal getSpaceAround()

Place children such that they are spaced evenly horizontally, including free space before the first child and after the last child, but half the amount of space existing otherwise between two consecutive children.

Unlike Arrangement.SpaceAround, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: #1##2##3##4#

getSpaceBetween

public final @NonNull Arrangement.Horizontal getSpaceBetween()

Place children such that they are spaced evenly across the main axis, without free space before the first child or after the last child.

Unlike Arrangement.SpaceBetween, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: 1##2##3

getSpaceEvenly

public final @NonNull Arrangement.Horizontal getSpaceEvenly()

Place children such that they are spaced evenly across the main axis, including free space before the first child and after the last child.

Unlike Arrangement.SpaceEvenly, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Visually: #1#2#3#

spacedBy

public final @NonNull Arrangement.HorizontalOrVertical spacedBy(@NonNull Dp space)

Place children such that each two adjacent ones are spaced by a fixed space distance across the main axis. The spacing will be subtracted from the available space that the children can occupy.

Unlike Arrangement.spacedBy, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Parameters
@NonNull Dp space

The space between adjacent children.

spacedBy

public final @NonNull Arrangement.Horizontal spacedBy(@NonNull Dp space, @NonNull Alignment.Horizontal alignment)

Place children horizontally such that each two adjacent ones are spaced by a fixed space distance. The spacing will be subtracted from the available width that the children can occupy. An alignment can be specified to align the spaced children horizontally inside the parent, in case there is empty width remaining.

Unlike Arrangement.spacedBy, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Parameters
@NonNull Dp space

The space between adjacent children.

@NonNull Alignment.Horizontal alignment

The alignment of the spaced children inside the parent.

spacedBy

public final @NonNull Arrangement.Vertical spacedBy(@NonNull Dp space, @NonNull Alignment.Vertical alignment)

Place children vertically such that each two adjacent ones are spaced by a fixed space distance. The spacing will be subtracted from the available height that the children can occupy. An alignment can be specified to align the spaced children vertically inside the parent, in case there is empty height remaining.

Unlike Arrangement.spacedBy, when the layout direction is RTL, the children will not be mirrored and as such children will appear in the order they are composed inside the Row.

Parameters
@NonNull Dp space

The space between adjacent children.

@NonNull Alignment.Vertical alignment

The alignment of the spaced children inside the parent.