to top
Android APIs
public static final class

BidiFormatter.Builder

extends Object
java.lang.Object
   ↳ android.text.BidiFormatter.Builder

Class Overview

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

Summary

Public Constructors
BidiFormatter.Builder()
Constructor.
BidiFormatter.Builder(boolean rtlContext)
Constructor.
BidiFormatter.Builder(Locale locale)
Constructor.
Public Methods
BidiFormatter build()
BidiFormatter.Builder setTextDirectionHeuristic(TextDirectionHeuristic heuristic)
Specifies the default directionality estimation algorithm to be used by the BidiFormatter.
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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BidiFormatter.Builder ()

Added in API level 18

Constructor.

public BidiFormatter.Builder (boolean rtlContext)

Added in API level 18

Constructor.

Parameters
rtlContext Whether the context directionality is RTL.

public BidiFormatter.Builder (Locale locale)

Added in API level 18

Constructor.

Parameters
locale The context locale.

Public Methods

public BidiFormatter build ()

Added in API level 18

Returns
  • A BidiFormatter with the specified options.

public BidiFormatter.Builder setTextDirectionHeuristic (TextDirectionHeuristic heuristic)

Added in API level 18

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

Parameters
heuristic the TextDirectionHeuristic to use.
Returns
  • the builder itself.

public BidiFormatter.Builder stereoReset (boolean stereoReset)

Added in API level 18

Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it. The default is false.