# TextDirectionHeuristicCompat

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  

# TextDirectionHeuristicCompat

| 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


interface
TextDirectionHeuristicCompat
`  
`


`

|------------------------------------------------------|
| android.support.v4.text.TextDirectionHeuristicCompat |

<br />

*** ** * ** ***

Interface for objects that use a heuristic for guessing at the paragraph direction by examining text.

## Summary

|                                                                                                                           ### Public methods                                                                                                                            ||
|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract boolean` | ` `[isRtl](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat#isRtl(char[], int, int))`(char[] array, int start, int count) ` Guess if a chars array is in the RTL direction or not.                     |
| ` abstract boolean` | ` `[isRtl](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat#isRtl(java.lang.CharSequence, int, int))`(CharSequence cs, int start, int count) ` Guess if a`CharSequence`is in the RTL direction or not. |

## Public methods

### isRtl

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

```
boolean isRtl (char[] array, 
                int start, 
                int count)
```

Guess if a chars array is in the RTL direction or not.

<br />

|                                                  Parameters                                                  ||
|---------|-----------------------------------------------------------------------------------------------------|
| `array` | `char`: the char array. <br />                                                                      |
| `start` | `int`: start index, inclusive. <br />                                                               |
| `count` | `int`: the length to check, must not be negative and not greater than`array.length - start`. <br /> |

|                                                  Returns                                                   ||
|-----------|-------------------------------------------------------------------------------------------------|
| `boolean` | true if all chars in the range are to be considered in a RTL direction, false otherwise. <br /> |

### isRtl

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

```
boolean isRtl (CharSequence cs, 
                int start, 
                int count)
```

Guess if a`CharSequence`is in the RTL direction or not.

<br />

|                                                      Parameters                                                       ||
|---------|--------------------------------------------------------------------------------------------------------------|
| `cs`    | `CharSequence`: the CharSequence. <br />                                                                     |
| `start` | `int`: start index, inclusive. <br />                                                                        |
| `count` | `int`: the length to check, must not be negative and not greater than`CharSequence.length() - start`. <br /> |

|                                                  Returns                                                   ||
|-----------|-------------------------------------------------------------------------------------------------|
| `boolean` | true if all chars in the range are to be considered in a RTL direction, false otherwise. <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)