Class TextUIConfig


  • public class TextUIConfig
    extends java.lang.Object
    A configurations of text. This provides a way of applying TextAppearance into this class's properties. A background color property is not applied automatically because background attributes is not a property of TextAppearance.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TextUIConfig.Builder  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TextUIConfig​(Parcel in)
      Constructor
    • Method Summary

      Modifier and Type Method Description
      TextUIConfig apply​(TextUIConfig config)
      Apply values in the given TextUIConfig into this.
      SpannableString apply​(Context context, java.lang.String text)
      Apply values into given whole text.
      void bind​(Context context, Spannable spannable, int start, int end)
      Apply values into Spannable text.
      int describeContents()  
      Typeface generateTypeface()
      Generates typeface from text style.
      int getCustomFontRes()
      Returns a custom font res ID.
      java.lang.String getFamilyName()
      Returns a value of text typeface family.
      int getTextBackgroundColor()
      Returns a value of background color int.
      int getTextColor()
      Returns a value of text color int.
      int getTextSize()
      Returns a value of text size int.
      int getTextStyle()
      Returns a value of android.graphics.Typeface.
      void mergeFromTextAppearance​(Context context, int textAppearance)
      Merge attributes into this instance's values by given TextAppearance.
      void mergeFromTextAppearance​(Context context, int textAppearance, int textBackgroundColor)
      Merge attributes into this instance's values by given TextAppearance and background color.
      void writeToParcel​(Parcel dest, int flags)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CREATOR

        public static final <any> CREATOR
    • Constructor Detail

      • TextUIConfig

        protected TextUIConfig​(@NonNull
                               Parcel in)
        Constructor
    • Method Detail

      • getTextBackgroundColor

        @ColorInt
        public int getTextBackgroundColor()
        Returns a value of background color int.
        Returns:
        A background color int value.
        Since:
        3.0.0
      • getTextColor

        @ColorInt
        public int getTextColor()
        Returns a value of text color int.
        Returns:
        A text color int value.
        Since:
        3.0.0
      • getTextStyle

        public int getTextStyle()
        Returns a value of android.graphics.Typeface.
      • Typeface.NORMAL
      • Typeface.BOLD
      • Typeface.ITALIC
      • Typeface.BOLD_ITALIC
Returns:
A text style of text.
Since:
3.0.0