Package icyllis.modernui.text
Class PrecomputedText.Params
java.lang.Object
icyllis.modernui.text.PrecomputedText.Params
- Enclosing class:
PrecomputedText
The information required for building
PrecomputedText
.
Contains information required for precomputing text measurement metadata, so it can be done
in isolation of a TextView
or StaticLayout
, when final layout
constraints are not known.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder for creatingPrecomputedText.Params
.static @interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for returning value of checkResultUsable indicating that given parameter is not compatible but partially usable for creating new PrecomputedText.static final int
Constant for returning value of checkResultUsable indicating that given parameter is not compatible.static final int
Constant for returning value of checkResultUsable indicating that given parameter is compatible. -
Constructor Summary
ConstructorDescriptionParams
(TextPaint paint, LineBreakConfig lineBreakConfig, TextDirectionHeuristic textDir) -
Method Summary
Modifier and TypeMethodDescriptionint
checkResultUsable
(TextPaint paint, TextDirectionHeuristic textDir, LineBreakConfig lbConfig) boolean
Check if the same text layout.Returns theLineBreakConfig
for this text.Returns theTextDirectionHeuristic
for this text.Returns theTextPaint
for this text.int
hashCode()
toString()
-
Field Details
-
UNUSABLE
@Internal public static final int UNUSABLEConstant for returning value of checkResultUsable indicating that given parameter is not compatible.- See Also:
-
NEED_RECOMPUTE
@Internal public static final int NEED_RECOMPUTEConstant for returning value of checkResultUsable indicating that given parameter is not compatible but partially usable for creating new PrecomputedText.- See Also:
-
USABLE
@Internal public static final int USABLEConstant for returning value of checkResultUsable indicating that given parameter is compatible.- See Also:
-
-
Constructor Details
-
Params
@Internal public Params(@NonNull TextPaint paint, @NonNull LineBreakConfig lineBreakConfig, @NonNull TextDirectionHeuristic textDir)
-
-
Method Details
-
getTextPaint
Returns theTextPaint
for this text.- Returns:
- A
TextPaint
-
getTextDirection
Returns theTextDirectionHeuristic
for this text.- Returns:
- A
TextDirectionHeuristic
-
getLineBreakConfig
Returns theLineBreakConfig
for this text.- Returns:
- the current line break configuration. The
LineBreakConfig
with default values will be returned if no line break configuration is set.
-
checkResultUsable
@Internal public int checkResultUsable(@NonNull TextPaint paint, @NonNull TextDirectionHeuristic textDir, @NonNull LineBreakConfig lbConfig) -
equals
Check if the same text layout. -
hashCode
public int hashCode() -
toString
-