Package icyllis.modernui.text

# Class PrecomputedText.Params

java.lang.Object
icyllis.modernui.text.PrecomputedText.Params

Enclosing class:
  `PrecomputedText`

public static final class PrecomputedText.Params extends Object
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

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `PrecomputedText.Params.Builder`
  A builder for creating `PrecomputedText.Params`.
  `static @interface`
  `PrecomputedText.Params.CheckResultUsableResult`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `NEED_RECOMPUTE`
  Constant for returning value of checkResultUsable indicating that given parameter is not compatible but partially usable for creating new PrecomputedText.
  `static final int`
  `UNUSABLE`
  Constant for returning value of checkResultUsable indicating that given parameter is not compatible.
  `static final int`
  `USABLE`
  Constant for returning value of checkResultUsable indicating that given parameter is compatible.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Params(TextPaint paint, LineBreakConfig lineBreakConfig, TextDirectionHeuristic textDir)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `checkResultUsable(TextPaint paint, TextDirectionHeuristic textDir, LineBreakConfig lbConfig)`
  `boolean`
  `equals(Object o)`
  Check if the same text layout.
  `LineBreakConfig`
  `getLineBreakConfig()`
  Returns the `LineBreakConfig` for this text.
  `TextDirectionHeuristic`
  `getTextDirection()`
  Returns the `TextDirectionHeuristic` for this text.
  `TextPaint`
  `getTextPaint()`
  Returns the `TextPaint` for this text.
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### UNUSABLE

    @Internal public static final int UNUSABLE
    Constant for returning value of checkResultUsable indicating that given parameter is not compatible.
    See Also:
      - Constant Field Values

  - ### NEED_RECOMPUTE

    @Internal public static final int NEED_RECOMPUTE
    Constant for returning value of checkResultUsable indicating that given parameter is not compatible but partially usable for creating new PrecomputedText.
    See Also:
      - Constant Field Values

  - ### USABLE

    @Internal public static final int USABLE
    Constant for returning value of checkResultUsable indicating that given parameter is compatible.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Params

    @Internal public Params(@NonNull TextPaint paint, @NonNull LineBreakConfig lineBreakConfig, @NonNull TextDirectionHeuristic textDir)

- ## Method Details

  - ### getTextPaint

    @NonNull public TextPaint getTextPaint()
    Returns the `TextPaint` for this text.
    Returns:
      A `TextPaint`

  - ### getTextDirection

    @NonNull public TextDirectionHeuristic getTextDirection()
    Returns the `TextDirectionHeuristic` for this text.
    Returns:
      A `TextDirectionHeuristic`

  - ### getLineBreakConfig

    @NonNull public LineBreakConfig getLineBreakConfig()
    Returns the `LineBreakConfig` 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

    public boolean equals(@Nullable Object o)
    Check if the same text layout.
    Overrides:
      `equals` in class `Object`
    Returns:
      true if this and the given param result in the same text layout

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`