Class LineBreakConfig

java.lang.Object
icyllis.modernui.graphics.text.LineBreakConfig

public final class LineBreakConfig extends Object
Indicates the strategies can be used when calculating the text wrapping.

See the line-break property See the word-break property

  • Field Details

    • LINE_BREAK_STYLE_NONE

      public static final int LINE_BREAK_STYLE_NONE
      No line break style specified.
      See Also:
    • LINE_BREAK_STYLE_LOOSE

      public static final int LINE_BREAK_STYLE_LOOSE
      Uses the least restrictive rule for line-breaking. Typically used for short lines.
      See Also:
    • LINE_BREAK_STYLE_NORMAL

      public static final int LINE_BREAK_STYLE_NORMAL
      Indicates breaking text with the most common set of line-breaking rules.
      See Also:
    • LINE_BREAK_STYLE_STRICT

      public static final int LINE_BREAK_STYLE_STRICT
      Indicates breaking text with the most stringent line-breaking rules.
      See Also:
    • LINE_BREAK_WORD_STYLE_NONE

      public static final int LINE_BREAK_WORD_STYLE_NONE
      No line break word style specified.
      See Also:
    • LINE_BREAK_WORD_STYLE_PHRASE

      public static final int LINE_BREAK_WORD_STYLE_PHRASE
      Indicates the line breaking is based on the phrased. This makes text wrapping only on meaningful words. The support of the text wrapping word style varies depending on the locales. If the locale does not support the phrase based text wrapping, there will be no effect.
      See Also:
    • LINE_BREAK_WORD_STYLE_NORMAL

      public static final int LINE_BREAK_WORD_STYLE_NORMAL
      Normal script/language behavior for midword breaks.
      See Also:
    • LINE_BREAK_WORD_STYLE_BREAK_ALL

      public static final int LINE_BREAK_WORD_STYLE_BREAK_ALL
      Allow midword breaks unless forbidden by line break style. To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).
      See Also:
    • LINE_BREAK_WORD_STYLE_KEEP_ALL

      public static final int LINE_BREAK_WORD_STYLE_KEEP_ALL
      Prohibit midword breaks except for dictionary breaks. Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.
      See Also:
    • NONE

      @Internal public static final LineBreakConfig NONE
  • Method Details

    • getLineBreakConfig

      @Internal @NonNull public static LineBreakConfig getLineBreakConfig(int lineBreakStyle, int lineBreakWordStyle)
      Create the LineBreakConfig instance.
      Parameters:
      lineBreakStyle - the line break style for text wrapping.
      lineBreakWordStyle - the line break word style for text wrapping.
      Returns:
      the LineBreakConfig instance.
    • getLineBreakStyle

      public int getLineBreakStyle()
      Get the line break style.
      Returns:
      The current line break style to be used for the text wrapping.
    • getLineBreakWordStyle

      public int getLineBreakWordStyle()
      Get the line break word style.
      Returns:
      The current line break word style to be used for the text wrapping.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object