Stay organized with collections
Save and categorize content based on your preferences.
TextDirectionHeuristic
interface TextDirectionHeuristic
Interface for objects that use a heuristic for guessing at the paragraph direction by examining text.
Summary
Public methods |
abstract Boolean |
Guess if a chars array is in the RTL direction or not.
|
abstract Boolean |
Guess if a CharSequence is in the RTL direction or not.
|
Public methods
isRtl
abstract fun isRtl(
array: CharArray!,
start: Int,
count: Int
): Boolean
Guess if a chars array is in the RTL direction or not.
Parameters |
array |
CharArray!: the char array. |
start |
Int: start index, inclusive. |
count |
Int: the length to check, must not be negative and not greater than array.length - start . |
Return |
Boolean |
true if all chars in the range are to be considered in a RTL direction, false otherwise. |
isRtl
abstract fun isRtl(
cs: CharSequence!,
start: Int,
count: Int
): Boolean
Guess if a CharSequence
is in the RTL direction or not.
Parameters |
cs |
CharSequence!: the CharSequence. |
start |
Int: start index, inclusive. |
count |
Int: the length to check, must not be negative and not greater than CharSequence.length() - start . |
Return |
Boolean |
true if all chars in the range are to be considered in a RTL direction, false otherwise. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TextDirectionHeuristic\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTextDirectionHeuristic\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/TextDirectionHeuristic \"View this page in Java\") \n\n```\ninterface TextDirectionHeuristic\n```\n\n|------------------------------------------|\n| [android.text.TextDirectionHeuristic](#) |\n\nInterface for objects that use a heuristic for guessing at the paragraph direction by examining text.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isRtl](#isRtl(kotlin.CharArray,%20kotlin.Int,%20kotlin.Int))`(`array:` `[CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!`, `start:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `count:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Guess if a chars array is in the RTL direction or not. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isRtl](#isRtl(kotlin.CharSequence,%20kotlin.Int,%20kotlin.Int))`(`cs:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `start:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `count:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Guess if a `CharSequence` is in the RTL direction or not. |\n\nPublic methods\n--------------\n\n### isRtl\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isRtl(\n array: CharArray!, \n start: Int, \n count: Int\n): Boolean\n```\n\nGuess if a chars array is in the RTL direction or not.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `array` | [CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!: the char array. |\n| `start` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): start index, inclusive. |\n| `count` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the length to check, must not be negative and not greater than `array.length - start`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if all chars in the range are to be considered in a RTL direction, false otherwise. |\n\n### isRtl\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isRtl(\n cs: CharSequence!, \n start: Int, \n count: Int\n): Boolean\n```\n\nGuess if a `CharSequence` is in the RTL direction or not.\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cs` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!: the CharSequence. |\n| `start` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): start index, inclusive. |\n| `count` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the length to check, must not be negative and not greater than `CharSequence.length() - start`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if all chars in the range are to be considered in a RTL direction, false otherwise. |"]]