Class TextViewUtils

  • All Implemented Interfaces:

    
    public class TextViewUtils
    
                        

    Handles text content for TextMessage and ReferenceMessage.

    • 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, @ColorInt() 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