Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.0.0-rc01

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

PrecomputedTextCompat.Params.Builder(TextPaint paint)

Builder constructor.

Public methods

PrecomputedTextCompat.Params build()

Build the PrecomputedTextCompat.Params.

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

PrecomputedTextCompat.Params.Builder

added in version 1.0.0
public PrecomputedTextCompat.Params.Builder (TextPaint paint)

Builder constructor.

Parameters
paint TextPaint: the paint to be used for drawing

Public methods

build

added in version 1.0.0
public PrecomputedTextCompat.Params build ()

Build the PrecomputedTextCompat.Params.

Returns
PrecomputedTextCompat.Params the layout parameter

setBreakStrategy

added in version 1.0.0
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

added in version 1.0.0
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

added in version 1.0.0
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