Added in API level 18

TextDirectionHeuristics


public class TextDirectionHeuristics
extends Object

java.lang.Object
   ↳ android.text.TextDirectionHeuristics


Some objects that implement 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.

Summary

Fields

public static final 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.

public static final 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.

public static final 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.

public static final TextDirectionHeuristic LOCALE

Force the paragraph direction to the Locale direction.

public static final TextDirectionHeuristic LTR

Always decides that the direction is left to right.

public static final TextDirectionHeuristic RTL

Always decides that the direction is right to left.

Public constructors

TextDirectionHeuristics()

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Fields

ANYRTL_LTR

Added in API level 18
public static final 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.

FIRSTSTRONG_LTR

Added in API level 18
public static final 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. This is the default behavior of the Unicode Bidirectional Algorithm.

FIRSTSTRONG_RTL

Added in API level 18
public static final 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. This is similar to the default behavior of the Unicode Bidirectional Algorithm, just with different fallback behavior.

LOCALE

Added in API level 18
public static final TextDirectionHeuristic LOCALE

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

LTR

Added in API level 18
public static final TextDirectionHeuristic LTR

Always decides that the direction is left to right.

RTL

Added in API level 18
public static final TextDirectionHeuristic RTL

Always decides that the direction is right to left.

Public constructors

TextDirectionHeuristics

public TextDirectionHeuristics ()