Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!

PrecomputedText.Params.Builder

public static class PrecomputedText.Params.Builder
extends Object

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


A builder for creating PrecomputedText.Params.

Summary

Public constructors

PrecomputedText.Params.Builder(TextPaint paint)

Builder constructor.

Public methods

PrecomputedText.Params build()

Build the PrecomputedText.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 setTextDirection(TextDirectionHeuristic textDir)

Set the text direction heuristic.

Inherited methods

Public constructors

PrecomputedText.Params.Builder

added in API level 28
public PrecomputedText.Params.Builder (TextPaint paint)

Builder constructor.

Parameters
paint TextPaint: the paint to be used for drawing

This value must never be null.

Public methods

build

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

Build the PrecomputedText.Params.

Returns
PrecomputedText.Params the layout parameter

This value will never 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.

Parameters
strategy int: the break strategy

Value is BREAK_STRATEGY_SIMPLE, BREAK_STRATEGY_HIGH_QUALITY or BREAK_STRATEGY_BALANCED.

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.

Parameters
frequency int: the hyphenation frequency

Value is HYPHENATION_FREQUENCY_NORMAL, HYPHENATION_FREQUENCY_FULL or HYPHENATION_FREQUENCY_NONE.

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

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 must never be null.

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