Start native apps faster with the Composables CLI ->
Interface

SpatialAlignment

An interface to calculate the position of a sized box inside an available 3D space.

Source set: Android
public interface SpatialAlignment

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

Functions

align

Source set: Android
public fun align(
        size: IntVolumeSize,
        space: IntVolumeSize,
        layoutDirection: LayoutDirection,
    ): Vector3

Provides the origin-based position of the content in the available space.

Parameters

size The content size in pixels.
space The available space in pixels.
layoutDirection LTR or RTL.

Members

Horizontal

Source set: Android
public interface Horizontal

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

Functions

align

Source set: Android
public fun align(size: Int, space: Int, layoutDirection: LayoutDirection): Int

Provides the horizontal alignment offset from the origin of the space to the origin of the content.

Parameters

size The content size in pixels.
space The available space in pixels.
layoutDirection LTR or RTL.

Vertical

Source set: Android
public interface Vertical

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

Functions

align

Source set: Android
public fun align(size: Int, space: Int): Int

Provides the vertical alignment offset from the origin of the space to the origin of the content.

Parameters

size The content size in pixels.
space The available space in pixels.

Depth

Source set: Android
public interface Depth

An interface to calculate the alignment of a box of a certain size inside an available depth.

Functions

align

Source set: Android
public fun align(size: Int, space: Int): Int

Provides the depth alignment offset from the origin of the space to the origin of the content.

Parameters

size The content size in pixels.
space The available space in pixels.

Companion

Source set: Android
public companion object

Properties

TopStart

Source set: Android
@JvmStatic public val TopStart: SpatialAlignment = SpatialBiasAlignment(-1f, 1f, 0f)

TopCenter

Source set: Android
@JvmStatic public val TopCenter: SpatialAlignment = SpatialBiasAlignment(0f, 1f, 0f)

TopEnd

Source set: Android
@JvmStatic public val TopEnd: SpatialAlignment = SpatialBiasAlignment(1f, 1f, 0f)

CenterStart

Source set: Android
@JvmStatic public val CenterStart: SpatialAlignment = SpatialBiasAlignment(-1f, 0f, 0f)

Center

Source set: Android
@JvmStatic public val Center: SpatialAlignment = SpatialBiasAlignment(0f, 0f, 0f)

CenterEnd

Source set: Android
@JvmStatic public val CenterEnd: SpatialAlignment = SpatialBiasAlignment(1f, 0f, 0f)

BottomStart

Source set: Android
@JvmStatic public val BottomStart: SpatialAlignment = SpatialBiasAlignment(-1f, -1f, 0f)

BottomCenter

Source set: Android
@JvmStatic public val BottomCenter: SpatialAlignment = SpatialBiasAlignment(0f, -1f, 0f)

BottomEnd

Source set: Android
@JvmStatic public val BottomEnd: SpatialAlignment = SpatialBiasAlignment(1f, -1f, 0f)

Start

Source set: Android
@JvmStatic public val Start: Horizontal = SpatialBiasAlignment.Horizontal(-1f)

CenterHorizontally

Source set: Android
@JvmStatic public val CenterHorizontally: Horizontal = SpatialBiasAlignment.Horizontal(0f)

End

Source set: Android
@JvmStatic public val End: Horizontal = SpatialBiasAlignment.Horizontal(1f)

Bottom

Source set: Android
@JvmStatic public val Bottom: Vertical = SpatialBiasAlignment.Vertical(-1f)

CenterVertically

Source set: Android
@JvmStatic public val CenterVertically: Vertical = SpatialBiasAlignment.Vertical(0f)

Top

Source set: Android
@JvmStatic public val Top: Vertical = SpatialBiasAlignment.Vertical(1f)

Back

Source set: Android
@JvmStatic public val Back: Depth = SpatialBiasAlignment.Depth(-1f)

CenterDepthwise

Source set: Android
@JvmStatic public val CenterDepthwise: Depth = SpatialBiasAlignment.Depth(0f)

Front

Source set: Android
@JvmStatic public val Front: Depth = SpatialBiasAlignment.Depth(1f)