PrecomputedText.Params.Builder


public static class PrecomputedText.Params.Builder
extends Object

java.lang.Object
   ↳ android.text.PrecomputedText.Params.Builder


A builder for creating Params.

Summary

Public constructors

Builder(PrecomputedText.Params params)

Builder constructor from existing params.

Builder(TextPaint paint)

Builder constructor.

Public methods

PrecomputedText.Params build()

Build the Params.

PrecomputedText.Params.Builder setBreakStrategy(int strategy)

Set the line break strategy.

PrecomputedText.Params.Builder setHyphenationFrequency(int frequency)

Set the hyphenation frequency.

PrecomputedText.Params.Builder setLineBreakConfig(LineBreakConfig lineBreakConfig)

Set the line break config for the text wrapping.

PrecomputedText.Params.Builder setTextDirection(TextDirectionHeuristic textDir)

Set the text direction heuristic.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 29
public Builder (PrecomputedText.Params params)

Builder constructor from existing params.

Parameters
params PrecomputedText.Params: This value cannot be null.

Builder

Added in API level 28
public Builder (TextPaint paint)

Builder constructor.

Parameters
paint TextPaint: the paint to be used for drawing This value cannot be null.

Public methods

build

Added in API level 28
public PrecomputedText.Params build ()

Build the Params.

Returns
PrecomputedText.Params the layout parameter This value cannot be null.

setBreakStrategy

Added in API level 28
public PrecomputedText.Params.Builder setBreakStrategy (int strategy)

Set the line break strategy. The default value is Layout.BREAK_STRATEGY_HIGH_QUALITY.

Returns
PrecomputedText.Params.Builder this builder, useful for chaining

setHyphenationFrequency

Added in API level 28
public PrecomputedText.Params.Builder setHyphenationFrequency (int frequency)

Set the hyphenation frequency. The default value is Layout.HYPHENATION_FREQUENCY_NORMAL.

Returns
PrecomputedText.Params.Builder this builder, useful for chaining

setLineBreakConfig

Added in API level 33
public PrecomputedText.Params.Builder setLineBreakConfig (LineBreakConfig lineBreakConfig)

Set the line break config for the text wrapping.

Parameters
lineBreakConfig LineBreakConfig: the newly line break configuration. This value cannot be null.

Returns
PrecomputedText.Params.Builder this builder, useful for chaining. This value cannot be null.

setTextDirection

Added in API level 28
public PrecomputedText.Params.Builder setTextDirection (TextDirectionHeuristic textDir)

Set the text direction heuristic. The default value is TextDirectionHeuristics.FIRSTSTRONG_LTR.

Parameters
textDir TextDirectionHeuristic: the text direction heuristic for resolving bidi behavior This value cannot be null.

Returns
PrecomputedText.Params.Builder this builder, useful for chaining