Builder
class Builder
kotlin.Any | |
↳ | android.text.PrecomputedText.Params.Builder |
A builder for creating Params
.
Summary
Public constructors | |
---|---|
Builder(params: PrecomputedText.Params) Builder constructor from existing params. |
|
Builder constructor. |
Public methods | |
---|---|
open PrecomputedText.Params |
build() Build the |
open PrecomputedText.Params.Builder! |
setBreakStrategy(strategy: Int) Set the line break strategy. |
open PrecomputedText.Params.Builder! |
setHyphenationFrequency(frequency: Int) Set the hyphenation frequency. |
open PrecomputedText.Params.Builder |
setLineBreakConfig(lineBreakConfig: LineBreakConfig) Set the line break config for the text wrapping. |
open PrecomputedText.Params.Builder! |
setTextDirection(textDir: TextDirectionHeuristic) Set the text direction heuristic. |
Public constructors
Builder
Builder(params: PrecomputedText.Params)
Builder constructor from existing params.
Parameters | |
---|---|
params |
PrecomputedText.Params: This value cannot be null . |
Builder
Builder(paint: TextPaint)
Builder constructor.
Parameters | |
---|---|
paint |
TextPaint: the paint to be used for drawing This value cannot be null . |
Public methods
build
open fun build(): PrecomputedText.Params
Build the Params
.
Return | |
---|---|
PrecomputedText.Params |
the layout parameter This value cannot be null . |
setBreakStrategy
open fun setBreakStrategy(strategy: Int): PrecomputedText.Params.Builder!
Set the line break strategy. The default value is Layout.BREAK_STRATEGY_HIGH_QUALITY
.
Parameters | |
---|---|
strategy |
Int: the break strategy Value is android.graphics.text.LineBreaker#BREAK_STRATEGY_SIMPLE , android.graphics.text.LineBreaker#BREAK_STRATEGY_HIGH_QUALITY , or android.graphics.text.LineBreaker#BREAK_STRATEGY_BALANCED |
Return | |
---|---|
PrecomputedText.Params.Builder! |
this builder, useful for chaining |
setHyphenationFrequency
open fun setHyphenationFrequency(frequency: Int): PrecomputedText.Params.Builder!
Set the hyphenation frequency. The default value is Layout.HYPHENATION_FREQUENCY_NORMAL
.
Parameters | |
---|---|
frequency |
Int: the hyphenation frequency Value is android.text.Layout#HYPHENATION_FREQUENCY_NORMAL , android.text.Layout#HYPHENATION_FREQUENCY_NORMAL_FAST , android.text.Layout#HYPHENATION_FREQUENCY_FULL , android.text.Layout#HYPHENATION_FREQUENCY_FULL_FAST , or android.text.Layout#HYPHENATION_FREQUENCY_NONE |
Return | |
---|---|
PrecomputedText.Params.Builder! |
this builder, useful for chaining |
setLineBreakConfig
open fun setLineBreakConfig(lineBreakConfig: LineBreakConfig): PrecomputedText.Params.Builder
Set the line break config for the text wrapping.
Parameters | |
---|---|
lineBreakConfig |
LineBreakConfig: the newly line break configuration. This value cannot be null . |
Return | |
---|---|
PrecomputedText.Params.Builder |
this builder, useful for chaining. This value cannot be null . |
setTextDirection
open fun setTextDirection(textDir: TextDirectionHeuristic): PrecomputedText.Params.Builder!
Set the text direction heuristic. The default value is TextDirectionHeuristics.FIRSTSTRONG_LTR
.
Parameters | |
---|---|
textDir |
TextDirectionHeuristic: the text direction heuristic for resolving bidi behavior This value cannot be null . |
Return | |
---|---|
PrecomputedText.Params.Builder! |
this builder, useful for chaining |