TextAlign


Aligns text horizontally within its container.

Summary

Public companion functions

TextAlign
valueOf(value: Int)

Creates TextAlign from value.

Cmn
List<TextAlign>

Return a list containing all possible values of TextAlign.

Cmn

Public companion properties

TextAlign

Aligns text to the center.

Cmn
TextAlign

Aligns text to the trailing edge.

Cmn
TextAlign

Stretches lines of text to fill the container width.

Cmn
TextAlign

Aligns text to the left edge.

Cmn
TextAlign

Aligns text to the right edge.

Cmn
TextAlign

Aligns text to the leading edge.

Cmn
TextAlign

Represents an unset TextAlign value.

Cmn

Public functions

open String
Cmn

Public properties

Int

internal integer representation of the text alignment.

Cmn

Extension functions

inline TextAlign

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Cmn

Extension properties

Boolean

Returns true if this TextAlign is not TextAlign.Unspecified.

Cmn

Public companion functions

valueOf

fun valueOf(value: Int): TextAlign

Creates TextAlign from value.

Useful for serialization/deserialization.

Parameters
value: Int

internal integer representation.

Throws
IllegalArgumentException

if value is invalid.

See also
value

values

fun values(): List<TextAlign>

Return a list containing all possible values of TextAlign.

Public companion properties

Center

val CenterTextAlign

Aligns text to the center.

End

val EndTextAlign

Aligns text to the trailing edge.

Maps to the right edge for LTR, and the left edge for RTL.

Justify

val JustifyTextAlign

Stretches lines of text to fill the container width.

Lines ending with hard line breaks align to Start.

Left

val LeftTextAlign

Aligns text to the left edge.

Right

val RightTextAlign

Aligns text to the right edge.

Start

val StartTextAlign

Aligns text to the leading edge.

Maps to the left edge for LTR, and the right edge for RTL.

Unspecified

val UnspecifiedTextAlign

Represents an unset TextAlign value.

Public functions

toString

open fun toString(): String

Public properties

value

val valueInt

internal integer representation of the text alignment.

Extension functions

TextAlign.takeOrElse

inline fun TextAlign.takeOrElse(block: () -> TextAlign): TextAlign

If isSpecified is true then this is returned, otherwise block is executed and its result is returned.

Extension properties

TextAlign.isSpecified

val TextAlign.isSpecifiedBoolean

Returns true if this TextAlign is not TextAlign.Unspecified.

See also
Unspecified