PrecomputedTextCompat.Params

Added in 1.1.0

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

Added in 1.1.0
@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

Added in 1.1.0
@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

Added in 1.1.0
@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

Added in 1.1.0
public @Nullable TextDirectionHeuristic getTextDirection()

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

getTextPaint

Added in 1.1.0
public @NonNull TextPaint getTextPaint()

Returns the TextPaint for this text.

hashCode

public int hashCode()

toString

public String toString()