PrecomputedTextCompat.Params.Builder
public
static
class
PrecomputedTextCompat.Params.Builder
extends Object
java.lang.Object | |
↳ | androidx.core.text.PrecomputedTextCompat.Params.Builder |
A builder for creating PrecomputedTextCompat.Params
.
Summary
Public constructors | |
---|---|
Builder(TextPaint paint)
Builder constructor. |
Public methods | |
---|---|
PrecomputedTextCompat.Params
|
build()
Build the |
PrecomputedTextCompat.Params.Builder
|
setBreakStrategy(int strategy)
Set the line break strategy. |
PrecomputedTextCompat.Params.Builder
|
setHyphenationFrequency(int frequency)
Set the hyphenation frequency. |
PrecomputedTextCompat.Params.Builder
|
setTextDirection(TextDirectionHeuristic textDir)
Set the text direction heuristic. |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (TextPaint paint)
Builder constructor.
Parameters | |
---|---|
paint |
TextPaint : the paint to be used for drawing
|
Public methods
build
public PrecomputedTextCompat.Params build ()
Build the PrecomputedTextCompat.Params
.
Returns | |
---|---|
PrecomputedTextCompat.Params |
the layout parameter |
setBreakStrategy
public PrecomputedTextCompat.Params.Builder setBreakStrategy (int strategy)
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 |
Returns | |
---|---|
PrecomputedTextCompat.Params.Builder |
PrecomputedTextCompat.Builder instance |
setHyphenationFrequency
public PrecomputedTextCompat.Params.Builder setHyphenationFrequency (int frequency)
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 |
Returns | |
---|---|
PrecomputedTextCompat.Params.Builder |
PrecomputedTextCompat.Builder instance |
setTextDirection
public PrecomputedTextCompat.Params.Builder setTextDirection (TextDirectionHeuristic textDir)
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 |
Returns | |
---|---|
PrecomputedTextCompat.Params.Builder |
PrecomputedTextCompat.Builder instance |