Google is committed to advancing racial equity for Black communities. See how.

Alignment

interface Alignment
androidx.compose.ui.Alignment

Summary

Nested classes
abstract

abstract

Public methods
abstract Unit

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

abstract Unit

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

abstract 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.

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

Companion properties
Alignment.Vertical

Alignment

Alignment

Alignment

Alignment

Alignment

Alignment.Horizontal

Alignment

Alignment.Vertical

Alignment.Horizontal

Alignment.Horizontal

Alignment.Vertical

Alignment

Alignment

Alignment

Public methods

<no name provided>

@Immutable abstract fun <no name provided>(): Unit

An interface to calculate the position of box of a certain width inside an available width. Alignment.Horizontal is often used to define the horizontal alignment of a layout inside a parent layout.

<no name provided>

@Immutable abstract fun <no name provided>(): Unit

An interface to calculate the position of a box of a certain height inside an available height. Alignment.Vertical is often used to define the vertical alignment of a layout inside a parent layout.

align

abstract 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.

align

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

Deprecated.

Companion properties

Bottom

@Stable val Bottom: Alignment.Vertical

BottomCenter

@Stable val BottomCenter: Alignment

BottomEnd

@Stable val BottomEnd: Alignment

BottomStart

@Stable val BottomStart: Alignment

Center

@Stable val Center: Alignment

CenterEnd

@Stable val CenterEnd: Alignment

CenterHorizontally

@Stable val CenterHorizontally: Alignment.Horizontal

CenterStart

@Stable val CenterStart: Alignment

CenterVertically

@Stable val CenterVertically: Alignment.Vertical

End

@Stable val End: Alignment.Horizontal

Start

@Stable val Start: Alignment.Horizontal

Top

@Stable val Top: Alignment.Vertical

TopCenter

@Stable val TopCenter: Alignment

TopEnd

@Stable val TopEnd: Alignment

TopStart

@Stable val TopStart: Alignment