Builder
class Builder
kotlin.Any | |
↳ | androidx.core.text.PrecomputedTextCompat.Params.Builder |
A builder for creating Params
.
Summary
Public constructors | |
---|---|
Builder constructor. |
Public methods | |
---|---|
open PrecomputedTextCompat.Params |
build() Build the |
open PrecomputedTextCompat.Params.Builder! |
setBreakStrategy(strategy: Int) Set the line break strategy. |
open PrecomputedTextCompat.Params.Builder! |
setHyphenationFrequency(frequency: Int) Set the hyphenation frequency. |
open PrecomputedTextCompat.Params.Builder! |
setTextDirection(@NonNull textDir: TextDirectionHeuristic) Set the text direction heuristic. |
Public constructors
<init>
Builder(@NonNull paint: TextPaint)
Builder constructor.
Parameters | |
---|---|
paint |
TextPaint: the paint to be used for drawing |
Public methods
build
@NonNull open fun build(): PrecomputedTextCompat.Params
Build the Params
.
Return | |
---|---|
PrecomputedTextCompat.Params |
the layout parameter |
setBreakStrategy
@RequiresApi(23) 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 |
setHyphenationFrequency
@RequiresApi(23) 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 |
setTextDirection
@RequiresApi(18) 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 |