Alignment

Known direct subclasses
BiasAbsoluteAlignment

An Alignment specified by bias: for example, a bias of -1 represents alignment to the left/top, a bias of 0 will represent centering, and a bias of 1 will represent right/bottom.

BiasAlignment

An Alignment specified by bias: for example, a bias of -1 represents alignment to the start/top, a bias of 0 will represent centering, and a bias of 1 will represent end/bottom.


An interface to calculate the position of a sized box inside an available space. Alignment is often used to define the alignment of a layout inside a parent layout.

Summary

Nested types

fun interface Alignment.Horizontal

An interface to calculate the position of box of a certain width inside an available width.

fun interface Alignment.Vertical

An interface to calculate the position of a box of a certain height inside an available height.

Public functions

IntOffset
align(size: IntSize, space: IntSize, layoutDirection: LayoutDirection)

Calculates the position of a box of size size relative to the top left corner of an area of size space.

Cmn

Public companion properties

Bottom

val BottomAlignment.Vertical

BottomCenter

val BottomCenterAlignment

BottomEnd

val BottomEndAlignment

BottomStart

val BottomStartAlignment

Center

val CenterAlignment

CenterEnd

val CenterEndAlignment

CenterHorizontally

val CenterHorizontallyAlignment.Horizontal

CenterStart

val CenterStartAlignment

CenterVertically

val CenterVerticallyAlignment.Vertical

End

val EndAlignment.Horizontal

Start

val StartAlignment.Horizontal

Top

val TopAlignment.Vertical

TopCenter

val TopCenterAlignment

TopEnd

val TopEndAlignment

TopStart

val TopStartAlignment

Public functions

align

fun align(size: IntSize, space: IntSize, layoutDirection: LayoutDirection): IntOffset

Calculates the position of a box of size size relative to the top left corner of an area of size space. The returned offset can be negative or larger than space - size, meaning that the box will be positioned partially or completely outside the area.