PrecomputedTextCompat.Params.Builder

Added in 1.1.0

public class PrecomputedTextCompat.Params.Builder


A builder for creating Params.

Summary

Public constructors

Builder constructor.

Public methods

@NonNull PrecomputedTextCompat.Params

Build the Params.

PrecomputedTextCompat.Params.Builder
setBreakStrategy(int strategy)

Set the line break strategy.

PrecomputedTextCompat.Params.Builder
setHyphenationFrequency(int frequency)

Set the hyphenation frequency.

PrecomputedTextCompat.Params.Builder

Set the text direction heuristic.

Public constructors

Builder

Added in 1.1.0
public Builder(@NonNull TextPaint paint)

Builder constructor.

Parameters
@NonNull TextPaint paint

the paint to be used for drawing

Public methods

build

Added in 1.1.0
public @NonNull PrecomputedTextCompat.Params build()

Build the Params.

Returns
@NonNull PrecomputedTextCompat.Params

the layout parameter

setBreakStrategy

Added in 1.1.0
public PrecomputedTextCompat.Params.Builder setBreakStrategy(int strategy)

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

Parameters
int strategy

the break strategy

Returns
PrecomputedTextCompat.Params.Builder

PrecomputedTextCompat.Builder instance

setHyphenationFrequency

Added in 1.1.0
public PrecomputedTextCompat.Params.Builder setHyphenationFrequency(int frequency)

Set the hyphenation frequency. The default value is HYPHENATION_FREQUENCY_NORMAL.

Parameters
int frequency

the hyphenation frequency

Returns
PrecomputedTextCompat.Params.Builder

PrecomputedTextCompat.Builder instance

setTextDirection

Added in 1.1.0
public PrecomputedTextCompat.Params.Builder setTextDirection(@NonNull TextDirectionHeuristic textDir)

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

Parameters
@NonNull TextDirectionHeuristic textDir

the text direction heuristic for resolving bidi behavior

Returns
PrecomputedTextCompat.Params.Builder

PrecomputedTextCompat.Builder instance

See also
setTextDirection