Stay organized with collections Save and categorize content based on your preferences.

PrecomputedTextCompat.Params

public final class PrecomputedTextCompat.Params


The information required for building PrecomputedTextCompat. Contains information required for precomputing text measurement metadata, so it can be done in isolation of a android.widget.TextView or StaticLayout, when final layout constraints are not known.

Summary

Nested types

A builder for creating Params.

Public constructors

Public methods

boolean

Check if the same text layout.

int

Returns the break strategy for this text.

int

Returns the hyphenation frequency for this text.

@Nullable TextDirectionHeuristic

Returns the TextDirectionHeuristic for this text.

@NonNull TextPaint

Returns the TextPaint for this text.

int
String

Public constructors

Params

@RequiresApi(value = 28)
public Params(@NonNull PrecomputedText.Params wrapped)

Public methods

equals

public boolean equals(@Nullable Object o)

Check if the same text layout.

Returns
boolean

true if this and the given param result in the same text layout

getBreakStrategy

@RequiresApi(value = 23)
public int getBreakStrategy()

Returns the break strategy for this text. On API 22 and below, this returns 0.

Returns
int

the line break strategy

getHyphenationFrequency

@RequiresApi(value = 23)
public int getHyphenationFrequency()

Returns the hyphenation frequency for this text. On API 22 and below, this returns 0.

Returns
int

the hyphenation frequency

getTextDirection

@RequiresApi(value = 18)
public @Nullable TextDirectionHeuristic getTextDirection()

Returns the TextDirectionHeuristic for this text. On API 17 and below, this returns null, otherwise returns non-null TextDirectionHeuristic.

getTextPaint

public @NonNull TextPaint getTextPaint()

Returns the TextPaint for this text.

hashCode

public int hashCode()

toString

public String toString()