Class TextViewUtils

  • All Implemented Interfaces:

    
    public class TextViewUtils
    
                        

    Handles text content for TextMessage and ReferenceMessage.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      TextViewUtils()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static SpannableStringBuilder getSpannable(String content, TextViewUtils.RegularCallBack callBack)
      static SpannableStringBuilder getSpannable(String content, boolean regular, TextViewUtils.RegularCallBack callBack)
      static SpannableStringBuilder getRichSpannable(String content, TextViewUtils.RegularCallBack callBack, int foregroundColor)
      static void setCompoundDrawables(TextView textView, int gravity, int resId) Sets compound drawables on a TextView using setCompoundDrawablesRelative.
      static void enableDrawableAutoMirror(TextView textView) Enables auto-mirroring for the TextView's compound Drawables, useful for directional Drawables in RTL layouts.
      • Methods inherited from class java.lang.Object

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

      • TextViewUtils

        TextViewUtils()
    • Method Detail

      • getSpannable

         static SpannableStringBuilder getSpannable(String content, TextViewUtils.RegularCallBack callBack)
        Parameters:
        content - the text content
        callBack - async callback for regex processing result
        Returns:

        the spannable content

      • getSpannable

         static SpannableStringBuilder getSpannable(String content, boolean regular, TextViewUtils.RegularCallBack callBack)
        Parameters:
        content - the text content
        callBack - async callback for regex processing result
        Returns:

        the spannable content

      • getRichSpannable

         static SpannableStringBuilder getRichSpannable(String content, TextViewUtils.RegularCallBack callBack, int foregroundColor)
        Parameters:
        content - the text content
        callBack - async callback for regex processing result
        Returns:

        the spannable content

      • setCompoundDrawables

         static void setCompoundDrawables(TextView textView, int gravity, int resId)

        Sets compound drawables on a TextView using setCompoundDrawablesRelative.

        Parameters:
        textView - the TextView
        gravity - only supports Gravity.START, Gravity.TOP, Gravity.END, or Gravity.
        resId - drawable resource ID
      • enableDrawableAutoMirror

         static void enableDrawableAutoMirror(TextView textView)

        Enables auto-mirroring for the TextView's compound Drawables, useful for directional Drawables in RTL layouts.

        Parameters:
        textView - the TextView