TextDirection


Defines the algorithm used to determine text direction.

Summary

Public companion functions

TextDirection
valueOf(value: Int)

Creates TextDirection from value.

Cmn

Public companion properties

TextDirection

Resolves direction using the first strong directional character according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

Resolves direction based on the first strong directional character according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

Resolves direction based on the first strong directional character according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

Sets the text direction to Left-to-Right.

Cmn
TextDirection

Sets the text direction to Right-to-Left.

Cmn
TextDirection

Represents an unset TextDirection value.

Cmn

Public functions

open String
Cmn

Public properties

Int

internal integer representation of the text direction.

Cmn

Extension functions

inline TextDirection

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 TextDirection is not TextDirection.Unspecified.

Cmn

Public companion functions

valueOf

fun valueOf(value: Int): TextDirection

Creates TextDirection from value.

Useful for serialization/deserialization.

Parameters
value: Int

internal integer representation.

Throws
IllegalArgumentException

if value is invalid.

See also
value

Public companion properties

Content

val ContentTextDirection

Resolves direction using the first strong directional character according to the Unicode Bidirectional Algorithm.

If no strong directional characters are present, falls back to androidx.compose.ui.unit.LayoutDirection, or to androidx.compose.ui.text.intl.LocaleList when creating a androidx.compose.ui.text.Paragraph (ignoring androidx.compose.ui.unit.LayoutDirection).

ContentOrLtr

val ContentOrLtrTextDirection

Resolves direction based on the first strong directional character according to the Unicode Bidirectional Algorithm.

Falls back to Left-to-Right if no strong directional characters are found.

ContentOrRtl

val ContentOrRtlTextDirection

Resolves direction based on the first strong directional character according to the Unicode Bidirectional Algorithm.

Falls back to Right-to-Left if no strong directional characters are found.

Ltr

val LtrTextDirection

Sets the text direction to Left-to-Right.

Rtl

val RtlTextDirection

Sets the text direction to Right-to-Left.

Unspecified

val UnspecifiedTextDirection

Represents an unset TextDirection value.

Public functions

toString

open fun toString(): String

Public properties

value

val valueInt

internal integer representation of the text direction.

Extension functions

TextDirection.takeOrElse

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

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

Extension properties

TextDirection.isSpecified

val TextDirection.isSpecifiedBoolean

Returns true if this TextDirection is not TextDirection.Unspecified.

See also
Unspecified