SpatialAlignment.Horizontal

interface SpatialAlignment.Horizontal

Known direct subclasses
SpatialBiasAbsoluteAlignment.Horizontal

Creates a weighted alignment that specifies a horizontal bias and independent of layout direction

SpatialBiasAlignment.Horizontal

Creates a weighted alignment that specifies a horizontal bias.


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

Summary

Public functions

Int
align(size: Int, space: Int, layoutDirection: LayoutDirection)

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

Public functions

align

Added in 1.0.0-alpha16
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: Int

The content size in pixels.

space: Int

The available space in pixels.

layoutDirection: LayoutDirection

LTR or RTL.