Android APIs
public static final class

BidiFormatter.Builder

extends Object
java.lang.Object
   ↳ android.support.v4.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(TextDirectionHeuristicCompat 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 ()

Constructor.

public BidiFormatter.Builder (boolean rtlContext)

Constructor.

Parameters
rtlContext Whether the context directionality is RTL.

public BidiFormatter.Builder (Locale locale)

Constructor.

Parameters
locale The context locale.

Public Methods

public BidiFormatter build ()

Returns
  • A BidiFormatter with the specified options.

public BidiFormatter.Builder setTextDirectionHeuristic (TextDirectionHeuristicCompat heuristic)

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)

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.