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
@RequiresApi(value = 23)
setBreakStrategy(int strategy)

Set the line break strategy.

PrecomputedTextCompat.Params.Builder
@RequiresApi(value = 23)
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
@RequiresApi(value = 23)
public PrecomputedTextCompat.Params.Builder setBreakStrategy(int strategy)

Set the line break strategy. The default value is BREAK_STRATEGY_HIGH_QUALITY. On API 22 and below, this has no effect as there is no line break strategy.

Parameters
int strategy

the break strategy

Returns
PrecomputedTextCompat.Params.Builder

PrecomputedTextCompat.Builder instance

setHyphenationFrequency

Added in 1.1.0
@RequiresApi(value = 23)
public PrecomputedTextCompat.Params.Builder setHyphenationFrequency(int frequency)

Set the hyphenation frequency. The default value is HYPHENATION_FREQUENCY_NORMAL. On API 22 and below, this has no effect as there is no hyphenation frequency.

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. On API 17 or before, text direction heuristics cannot be modified, so this method does nothing.

Parameters
@NonNull TextDirectionHeuristic textDir

the text direction heuristic for resolving bidi behavior

Returns
PrecomputedTextCompat.Params.Builder

PrecomputedTextCompat.Builder instance

See also
setTextDirection