Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

Builder

class Builder
kotlin.Any
   ↳ androidx.core.text.PrecomputedTextCompat.Params.Builder

A builder for creating Params.

Summary

Public constructors
<init>(@NonNull paint: TextPaint)

Builder constructor.

Public methods
open PrecomputedTextCompat.Params.Builder!
setBreakStrategy(strategy: Int)

Set the line break strategy.

open PrecomputedTextCompat.Params.Builder!

Set the text direction heuristic.

open PrecomputedTextCompat.Params.Builder!

Set the hyphenation frequency.

open PrecomputedTextCompat.Params

Build the Params.

Public constructors

<init>

Builder(@NonNull paint: TextPaint)

Builder constructor.

Parameters
paint TextPaint: the paint to be used for drawing

Public methods

setBreakStrategy

open fun setBreakStrategy(strategy: Int): PrecomputedTextCompat.Params.Builder!

Set the line break strategy. The default value is Layout#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
Return
PrecomputedTextCompat.Params.Builder!: PrecomputedTextCompat.Builder instance

setTextDirection

open fun setTextDirection(@NonNull textDir: TextDirectionHeuristic): PrecomputedTextCompat.Params.Builder!

Set the text direction heuristic. The default value is TextDirectionHeuristics#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
Return
PrecomputedTextCompat.Params.Builder!: PrecomputedTextCompat.Builder instance

setHyphenationFrequency

open fun setHyphenationFrequency(frequency: Int): PrecomputedTextCompat.Params.Builder!

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

Parameters
frequency Int: the hyphenation frequency
Return
PrecomputedTextCompat.Params.Builder!: PrecomputedTextCompat.Builder instance

build

@NonNull open fun build(): PrecomputedTextCompat.Params

Build the Params.

Return
PrecomputedTextCompat.Params: the layout parameter