Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A class for building a BidiFormatter with non-default options.
Summary
Public constructors |
Constructor.
|
Constructor.
|
Constructor.
|
Public methods |
BidiFormatter! |
|
BidiFormatter.Builder! |
Specifies the default directionality estimation algorithm to be used by the BidiFormatter.
|
BidiFormatter.Builder! |
Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it.
|
Public constructors
Builder
Builder()
Constructor.
Builder
Builder(rtlContext: Boolean)
Constructor.
Parameters |
rtlContext |
Boolean: Whether the context directionality is RTL. |
Builder
Builder(locale: Locale!)
Constructor.
Parameters |
locale |
Locale!: The context locale. |
Public methods
setTextDirectionHeuristic
fun setTextDirectionHeuristic(heuristic: TextDirectionHeuristic!): BidiFormatter.Builder!
Specifies the default directionality estimation algorithm to be used by the BidiFormatter. By default, uses the first-strong heuristic.
stereoReset
fun stereoReset(stereoReset: Boolean): BidiFormatter.Builder!
Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it. The default is true.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# BidiFormatter.Builder\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/BidiFormatter.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|-----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.text.BidiFormatter.Builder](#) |\n\nA class for building a BidiFormatter with non-default options.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder())`()` Constructor. |\n| [Builder](#Builder(kotlin.Boolean))`(`rtlContext:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Constructor. |\n| [Builder](#Builder(java.util.Locale))`(`locale:` `[Locale](../../java/util/Locale.html#)!`)` Constructor. |\n\n| Public methods ||\n|----------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [BidiFormatter](/reference/kotlin/android/text/BidiFormatter)! | [build](#build())`()` \u003cbr /\u003e |\n| [BidiFormatter.Builder](#)! | [setTextDirectionHeuristic](#setTextDirectionHeuristic(android.text.TextDirectionHeuristic))`(`heuristic:` `[TextDirectionHeuristic](/reference/kotlin/android/text/TextDirectionHeuristic)!`)` Specifies the default directionality estimation algorithm to be used by the BidiFormatter. |\n| [BidiFormatter.Builder](#)! | [stereoReset](#stereoReset(kotlin.Boolean))`(`stereoReset:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Specifies whether the BidiFormatter to be built should also \"reset\" directionality before a string being bidi-wrapped, not just after it. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder()\n```\n\nConstructor. \n\n### Builder\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(rtlContext: Boolean)\n```\n\nConstructor.\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------|\n| `rtlContext` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html): Whether the context directionality is RTL. |\n\n### Builder\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(locale: Locale!)\n```\n\nConstructor.\n\n| Parameters ||\n|----------|--------------------------------------------------------------|\n| `locale` | [Locale](../../java/util/Locale.html#)!: The context locale. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): BidiFormatter!\n```\n\n| Return ||\n|----------------------------------------------------------------|---------------------------------------------|\n| [BidiFormatter](/reference/kotlin/android/text/BidiFormatter)! | A BidiFormatter with the specified options. |\n\n### setTextDirectionHeuristic\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setTextDirectionHeuristic(heuristic: TextDirectionHeuristic!): BidiFormatter.Builder!\n```\n\nSpecifies the default directionality estimation algorithm to be used by the BidiFormatter. By default, uses the first-strong heuristic.\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------------------------------------------------------|\n| `heuristic` | [TextDirectionHeuristic](/reference/kotlin/android/text/TextDirectionHeuristic)!: the `TextDirectionHeuristic` to use. |\n\n| Return ||\n|-----------------------------|---------------------|\n| [BidiFormatter.Builder](#)! | the builder itself. |\n\n### stereoReset\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun stereoReset(stereoReset: Boolean): BidiFormatter.Builder!\n```\n\nSpecifies whether the BidiFormatter to be built should also \"reset\" directionality before a string being bidi-wrapped, not just after it. The default is true."]]