The second Android 11 Developer Preview is now available, test it out and share your feedback.

Alignment

enum class Alignment
kotlin.Any
   ↳ kotlin.Enum<androidx.ui.core.Alignment>
   ↳ androidx.ui.core.Alignment

Represents a positioning of a point inside a 2D box. Alignment is often used to define the alignment of a box inside a parent container. The coordinate space of the 2D box is the continuous -1f,1f range in both dimensions, so (verticalBias, horizontalBias) will be points in this space. (verticalBias=0f, horizontalBias=0f) represents the center of the box, (verticalBias=-1f, horizontalBias=1f) will be the top right, etc.

Summary

Enum values

Public methods

IntPxPosition
align(size: IntPxSize, layoutDirection: LayoutDirection = LayoutDirection.Ltr)

Returns the position of a 2D point in a container of a given size, according to this Alignment.

Enum values

BottomCenter

enum val BottomCenter : Alignment

BottomEnd

enum val BottomEnd : Alignment

BottomStart

enum val BottomStart : Alignment

Center

enum val Center : Alignment

CenterEnd

enum val CenterEnd : Alignment

CenterStart

enum val CenterStart : Alignment

TopCenter

enum val TopCenter : Alignment

TopEnd

enum val TopEnd : Alignment

TopStart

enum val TopStart : Alignment

Public methods

align

fun align(
    size: IntPxSize,
    layoutDirection: LayoutDirection = LayoutDirection.Ltr
): IntPxPosition

Returns the position of a 2D point in a container of a given size, according to this Alignment.