# TextDirectionHeuristicsCompat

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)   
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary: [Fields](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#lfields) \| [Inherited Methods](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#)  

# TextDirectionHeuristicsCompat

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public

final

class
TextDirectionHeuristicsCompat
`


`

extends Object


`

`


`

|---|-------------------------------------------------------|
| java.lang.Object                                         ||
| ↳ | android.support.v4.text.TextDirectionHeuristicsCompat |

<br />

*** ** * ** ***

Some objects that implement TextDirectionHeuristic.

## Summary

|                                                                                                                                                                                                                   ### Fields                                                                                                                                                                                                                    ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [ANYRTL_LTR](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#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 `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [FIRSTSTRONG_LTR](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#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 `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [FIRSTSTRONG_RTL](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#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 `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [LOCALE](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#LOCALE) Force the paragraph direction to the Locale direction.                                                                                                                      |
| ` public static final `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [LTR](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#LTR) Always decides that the direction is left to right.                                                                                                                               |
| ` public static final `[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat) | [RTL](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#RTL) Always decides that the direction is right to left.                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat#)From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Fields

### ANYRTL_LTR

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat 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.

<br />

### FIRSTSTRONG_LTR

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat 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.

<br />

### FIRSTSTRONG_RTL

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat 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.

<br />

### LOCALE

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat LOCALE
```

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

<br />

### LTR

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat LTR
```

Always decides that the direction is left to right.

<br />

### RTL

added in [version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
TextDirectionHeuristicCompat RTL
```

Always decides that the direction is right to left.

<br />

-

  ## Interfaces

  - [TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat)
-

  ## Classes

  - [BidiFormatter](https://developer.android.com/reference/android/support/v4/text/BidiFormatter)
  - [BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder)
  - [ICUCompat](https://developer.android.com/reference/android/support/v4/text/ICUCompat)
  - [TextDirectionHeuristicsCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicsCompat)
  - [TextUtilsCompat](https://developer.android.com/reference/android/support/v4/text/TextUtilsCompat)