public final class

BidiFormatter.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.core.text.BidiFormatter.Builder

Overview

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

Summary

Constructors
publicBuilder()

Constructor.

publicBuilder(boolean rtlContext)

Constructor.

publicBuilder(java.util.Locale locale)

Constructor.

Methods
public BidiFormatterbuild()

public BidiFormatter.BuildersetTextDirectionHeuristic(TextDirectionHeuristicCompat heuristic)

Specifies the default directionality estimation algorithm to be used by the BidiFormatter.

public BidiFormatter.BuilderstereoReset(boolean stereoReset)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Constructor.

public Builder(boolean rtlContext)

Constructor.

Parameters:

rtlContext: Whether the context directionality is RTL.

public Builder(java.util.Locale locale)

Constructor.

Parameters:

locale: The context locale.

Methods

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.

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 build()

Returns:

A BidiFormatter with the specified options.