public class TextDirectionHeuristics extends Object
TextDirectionHeuristic
. Use these with
the unicodeWrap()
methods in BidiFormatter
.
Also notice that these direction heuristics correspond to the same types of constants
provided in the View
class for setTextDirection()
, such as View.TEXT_DIRECTION_RTL
.
To support versions lower than Build.VERSION_CODES.JELLY_BEAN_MR2
,
you can use the support library's TextDirectionHeuristicsCompat
class.
Modifier and Type | Field and Description |
---|---|
static TextDirectionHeuristic |
ANYRTL_LTR
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 |
FIRSTSTRONG_LTR
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 |
FIRSTSTRONG_RTL
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 |
LOCALE
Force the paragraph direction to the Locale direction.
|
static TextDirectionHeuristic |
LTR
Always decides that the direction is left to right.
|
static TextDirectionHeuristic |
RTL
Always decides that the direction is right to left.
|
Constructor and Description |
---|
TextDirectionHeuristics() |
public static final TextDirectionHeuristic LTR
public static final TextDirectionHeuristic RTL
public static final TextDirectionHeuristic FIRSTSTRONG_LTR
public static final TextDirectionHeuristic FIRSTSTRONG_RTL
public static final TextDirectionHeuristic ANYRTL_LTR
public static final TextDirectionHeuristic LOCALE