PrecomputedTextCompat.Params.Builder

Added in 1.1.0

class PrecomputedTextCompat.Params.Builder


A builder for creating Params.

Summary

Public constructors

Builder constructor.

Public functions

PrecomputedTextCompat.Params

Build the Params.

PrecomputedTextCompat.Params.Builder!
@RequiresApi(value = 23)
setBreakStrategy(strategy: Int)

Set the line break strategy.

PrecomputedTextCompat.Params.Builder!
@RequiresApi(value = 23)
setHyphenationFrequency(frequency: Int)

Set the hyphenation frequency.

PrecomputedTextCompat.Params.Builder!

Set the text direction heuristic.

Public constructors

Builder

Added in 1.1.0
Builder(paint: TextPaint)

Builder constructor.

Parameters
paint: TextPaint

the paint to be used for drawing

Public functions

build

Added in 1.1.0
fun build(): PrecomputedTextCompat.Params

Build the Params.

Returns
PrecomputedTextCompat.Params

the layout parameter

setBreakStrategy

Added in 1.1.0
@RequiresApi(value = 23)
fun setBreakStrategy(strategy: Int): PrecomputedTextCompat.Params.Builder!

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
strategy: Int

the break strategy

Returns
PrecomputedTextCompat.Params.Builder!

PrecomputedTextCompat.Builder instance

setHyphenationFrequency

Added in 1.1.0
@RequiresApi(value = 23)
fun setHyphenationFrequency(frequency: Int): PrecomputedTextCompat.Params.Builder!

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
frequency: Int

the hyphenation frequency

Returns
PrecomputedTextCompat.Params.Builder!

PrecomputedTextCompat.Builder instance

setTextDirection

Added in 1.1.0
fun setTextDirection(textDir: TextDirectionHeuristic): PrecomputedTextCompat.Params.Builder!

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
textDir: TextDirectionHeuristic

the text direction heuristic for resolving bidi behavior

Returns
PrecomputedTextCompat.Params.Builder!

PrecomputedTextCompat.Builder instance

See also
setTextDirection