common • net.kernelpanicsoft.archie.gui.layout • Arrangement
Arrangement
@Immutableobject ArrangementUsed to specify the arrangement of the layout's children in layouts like Row or Column in the main axis direction (horizontal and vertical, respectively).
Below is an illustration of different horizontal arrangements in Rows:
Different vertical arrangements in Columns:
Types
Absolute
@Immutableobject AbsoluteHorizontal
@Stableinterface HorizontalUsed to specify the horizontal arrangement of the layout's children in layouts like Row.
HorizontalOrVertical
@Stableinterface HorizontalOrVertical : Arrangement.Horizontal, Arrangement.VerticalUsed to specify the horizontal arrangement of the layout's children in horizontal layouts like Row, or the vertical arrangement of the layout's children in vertical layouts like Column.
Vertical
@Stableinterface VerticalUsed to specify the vertical arrangement of the layout's children in layouts like Column.
Properties
Bottom
@Stableval Bottom: Arrangement.VerticalPlace children vertically such that they are as close as possible to the bottom of the main axis. Visually: (top) ####123 (bottom)
Center
@Stableval Center: Arrangement.HorizontalOrVerticalPlace children such that they are as close as possible to the middle of the main axis. Visually: ##123## for LTR and ##321## for RTL.
End
@Stableval End: Arrangement.HorizontalPlace children horizontally such that they are as close as possible to the end of the main axis. Visually: ####123 for LTR and 321#### for RTL.
SpaceAround
@Stableval SpaceAround: Arrangement.HorizontalOrVerticalPlace children such that they are spaced evenly across the main axis, including free space before the first child and after the last child, but half the amount of space existing otherwise between two consecutive children. Visually: #1##2##3# for LTR and #3##2##1# for RTL
SpaceBetween
@Stableval SpaceBetween: Arrangement.HorizontalOrVerticalPlace children such that they are spaced evenly across the main axis, without free space before the first child or after the last child. Visually: 1##2##3 for LTR or 3##2##1 for RTL.
SpaceEvenly
@Stableval SpaceEvenly: Arrangement.HorizontalOrVerticalPlace children such that they are spaced evenly across the main axis, including free space before the first child and after the last child. Visually: #1#2#3# for LTR and #3#2#1# for RTL.
Start
@Stableval Start: Arrangement.HorizontalPlace children horizontally such that they are as close as possible to the beginning of the horizontal axis (left if the layout direction is LTR, right otherwise). Visually: 123#### for LTR and ####321.
Top
@Stableval Top: Arrangement.VerticalPlace children vertically such that they are as close as possible to the top of the main axis. Visually: (top) 123#### (bottom)
Functions
aligned
@Stablefun aligned(alignment: Alignment.Horizontal): Arrangement.HorizontalPlace children horizontally one next to the other and align the obtained group according to an alignment.
@Stablefun aligned(alignment: Alignment.Vertical): Arrangement.VerticalPlace children vertically one next to the other and align the obtained group according to an alignment.
spacedBy
@Stablefun spacedBy(space: Dp): Arrangement.HorizontalOrVerticalPlace 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. The space can be negative, in which case children will overlap.
@Stablefun spacedBy(space: Dp, alignment: Alignment.Horizontal): Arrangement.HorizontalPlace 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. The space can be negative, in which case children will overlap.
@Stablefun spacedBy(space: Dp, alignment: Alignment.Vertical): Arrangement.VerticalPlace 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. The space can be negative, in which case children will overlap.