# BidiFormatter.Builder

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:[Ctors](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#)  

# BidiFormatter.Builder

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

class
BidiFormatter.Builder
`  
`

extends Object


``


`

|---|-----------------------------------------------|
| java.lang.Object                                 ||
| ↳ | android.support.v4.text.BidiFormatter.Builder |

<br />

*** ** * ** ***

A class for building a BidiFormatter with non-default options.

## Summary

|                                                                                   ### Public constructors                                                                                   ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#BidiFormatter.Builder())`() ` Constructor.                              |
| ` `[BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#BidiFormatter.Builder(boolean))`(boolean rtlContext) ` Constructor.     |
| ` `[BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#BidiFormatter.Builder(java.util.Locale))`(Locale locale) ` Constructor. |

|                                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                                        ||
|-------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[BidiFormatter](https://developer.android.com/reference/android/support/v4/text/BidiFormatter)                 | ` `[build](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#build())`() `                                                                                                                                                                                                                                                                                                                                |
| ` `[BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder) | ` `[setTextDirectionHeuristic](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#setTextDirectionHeuristic(android.support.v4.text.TextDirectionHeuristicCompat))`(`[TextDirectionHeuristicCompat](https://developer.android.com/reference/android/support/v4/text/TextDirectionHeuristicCompat)` heuristic) ` Specifies the default directionality estimation algorithm to be used by the BidiFormatter. |
| ` `[BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder) | ` `[stereoReset](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#stereoReset(boolean))`(boolean stereoReset) ` Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it.                                                                                                                                                |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder#)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() `                    | ||

## Public constructors

### BidiFormatter.Builder

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

```
BidiFormatter.Builder ()
```

Constructor.

<br />

### BidiFormatter.Builder

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

```
BidiFormatter.Builder (boolean rtlContext)
```

Constructor.

<br />

|                                 Parameters                                 ||
|--------------|--------------------------------------------------------------|
| `rtlContext` | `boolean`: Whether the context directionality is RTL. <br /> |

### BidiFormatter.Builder

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

```
BidiFormatter.Builder (Locale locale)
```

Constructor.

<br />

|                   Parameters                   ||
|----------|--------------------------------------|
| `locale` | `Locale`: The context locale. <br /> |

## Public methods

### build

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

```
BidiFormatter build ()
```

<br />

<br />

|                                                                      Returns                                                                       ||
|------------------------------------------------------------------------------------------------|----------------------------------------------------|
| [BidiFormatter](https://developer.android.com/reference/android/support/v4/text/BidiFormatter) | A BidiFormatter with the specified options. <br /> |

### setTextDirectionHeuristic

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

```
BidiFormatter.Builder setTextDirectionHeuristic (TextDirectionHeuristicCompat heuristic)
```

Specifies the default directionality estimation algorithm to be used by the BidiFormatter. By default, uses the first-strong heuristic.

<br />

|                                       Parameters                                       ||
|-------------|---------------------------------------------------------------------------|
| `heuristic` | `TextDirectionHeuristicCompat`: the`TextDirectionHeuristic`to use. <br /> |

|                                                                  Returns                                                                   ||
|----------------------------------------------------------------------------------------------------------------|----------------------------|
| [BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder) | the builder itself. <br /> |

### stereoReset

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

```
BidiFormatter.Builder stereoReset (boolean stereoReset)
```

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.

<br />

|           Parameters            ||
|---------------|------------------|
| `stereoReset` | `boolean` <br /> |

|                                                        Returns                                                         ||
|----------------------------------------------------------------------------------------------------------------|--------|
| [BidiFormatter.Builder](https://developer.android.com/reference/android/support/v4/text/BidiFormatter.Builder) | <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)