Added in API level 18

TextDirectionHeuristics


open class TextDirectionHeuristics
kotlin.Any
   ↳ android.text.TextDirectionHeuristics

Some objects that implement TextDirectionHeuristic. Use these with the android.text.BidiFormatter#unicodeWrap methods in BidiFormatter. Also notice that these direction heuristics correspond to the same types of constants provided in the android.view.View class for setTextDirection(), such as android.view.View#TEXT_DIRECTION_RTL.

To support versions lower than android.os.Build.VERSION_CODES#JELLY_BEAN_MR2, you can use the support library's androidx.core.text.TextDirectionHeuristicsCompat class.

Summary

Public constructors

Properties
static TextDirectionHeuristic!

If the text contains any strong right to left non-format character, determines that the direction is right to left, falling back to left to right if it finds none.

static TextDirectionHeuristic!

Determines the direction based on the first strong directional character, including bidi format chars, falling back to left to right if it finds none.

static TextDirectionHeuristic!

Determines the direction based on the first strong directional character, including bidi format chars, falling back to right to left if it finds none.

static TextDirectionHeuristic!

Force the paragraph direction to the Locale direction.

static TextDirectionHeuristic!

Always decides that the direction is left to right.

static TextDirectionHeuristic!

Always decides that the direction is right to left.

Public constructors

TextDirectionHeuristics

TextDirectionHeuristics()

Properties

ANYRTL_LTR

Added in API level 18
static val ANYRTL_LTR: TextDirectionHeuristic!

If the text contains any strong right to left non-format character, determines that the direction is right to left, falling back to left to right if it finds none.

FIRSTSTRONG_LTR

Added in API level 18
static val FIRSTSTRONG_LTR: TextDirectionHeuristic!

Determines the direction based on the first strong directional character, including bidi format chars, falling back to left to right if it finds none. This is the default behavior of the Unicode Bidirectional Algorithm.

FIRSTSTRONG_RTL

Added in API level 18
static val FIRSTSTRONG_RTL: TextDirectionHeuristic!

Determines the direction based on the first strong directional character, including bidi format chars, falling back to right to left if it finds none. This is similar to the default behavior of the Unicode Bidirectional Algorithm, just with different fallback behavior.

LOCALE

Added in API level 18
static val LOCALE: TextDirectionHeuristic!

Force the paragraph direction to the Locale direction. Falls back to left to right.

LTR

Added in API level 18
static val LTR: TextDirectionHeuristic!

Always decides that the direction is left to right.

RTL

Added in API level 18
static val RTL: TextDirectionHeuristic!

Always decides that the direction is right to left.