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

BiasAlignment

@Immutable data class BiasAlignment : Alignment
kotlin.Any
   ↳ androidx.compose.ui.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. Any value can be specified to obtain an alignment. Inside the -1,1 range, the obtained alignment will position the aligned size fully inside the available space, while outside the range it will the aligned size will be positioned partially or completely outside.

Summary

Nested classes
data

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

data

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

Public constructors
<init>(horizontalBias: Float, verticalBias: Float)

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.

Public methods
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.

Inherited functions
Properties
Float

Float

Public constructors

<init>

BiasAlignment(
    horizontalBias: Float,
    verticalBias: Float)

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. Any value can be specified to obtain an alignment. Inside the -1,1 range, the obtained alignment will position the aligned size fully inside the available space, while outside the range it will the aligned size will be positioned partially or completely outside.

Public methods

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.

Properties

horizontalBias

val horizontalBias: Float

verticalBias

val verticalBias: Float