Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.0.0-rc01

BidiFormatter.Builder

public static final class BidiFormatter.Builder
extends Object

java.lang.Object
   ↳ androidx.core.text.BidiFormatter.Builder


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.

Inherited methods

Public constructors

BidiFormatter.Builder

added in version 1.0.0
public BidiFormatter.Builder ()

Constructor.

BidiFormatter.Builder

added in version 1.0.0
public BidiFormatter.Builder (boolean rtlContext)

Constructor.

Parameters
rtlContext boolean: Whether the context directionality is RTL.

BidiFormatter.Builder

added in version 1.0.0
public BidiFormatter.Builder (Locale locale)

Constructor.

Parameters
locale Locale: The context locale.

Public methods

build

added in version 1.0.0
public BidiFormatter build ()

Returns
BidiFormatter A BidiFormatter with the specified options.

setTextDirectionHeuristic

added in version 1.0.0
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 TextDirectionHeuristicCompat: the TextDirectionHeuristic to use.

Returns
BidiFormatter.Builder the builder itself.

stereoReset

added in version 1.0.0
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 true.

Parameters
stereoReset boolean

Returns
BidiFormatter.Builder