TextDirection


Defines the algorithm to be used while determining the text direction.

Summary

Public companion functions

TextDirection
valueOf(value: Int)

Creates a TextDirection from the given integer value.

Cmn

Public companion properties

TextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm.

Cmn
TextDirection

Always sets the text direction to be Left to Right.

Cmn
TextDirection

Always sets the text direction to be Right to Left.

Cmn
TextDirection

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Cmn

Public functions

open String
Cmn

Public properties

Int

The integer representation of TextDirection.

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 a TextDirection from the given integer value. This can be useful if you need to serialize/deserialize TextDirection values.

Parameters
value: Int

The integer representation of the TextDirection.

Throws
kotlin.IllegalArgumentException

if the given value is not recognized.

See also
value

Public companion properties

Content

val ContentTextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm. If no strong directional character is present, then androidx.compose.ui.unit.LayoutDirection is used to resolve the final TextDirection.

ContentOrLtr

val ContentOrLtrTextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm. If no strong directional character is present, then Left to Right will be used as the default direction.

ContentOrRtl

val ContentOrRtlTextDirection

This value indicates that the text direction depends on the first strong directional character in the text according to the Unicode Bidirectional Algorithm. If no strong directional character is present, then Right to Left will be used as the default direction.

Ltr

val LtrTextDirection

Always sets the text direction to be Left to Right.

Rtl

val RtlTextDirection

Always sets the text direction to be Right to Left.

Unspecified

val UnspecifiedTextDirection

This represents an unset value, a usual replacement for "null" when a primitive value is desired.

Public functions

toString

open fun toString(): String

Public properties

value

val valueInt

The integer representation of TextDirection.

Extension functions

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

isSpecified

val TextDirection.isSpecifiedBoolean

Returns true if this TextDirection is not TextDirection.Unspecified.

See also
Unspecified