类 DynamicDrawableSpan

  • 所有已实现的接口:
    android.text.style.UpdateAppearance, android.text.style.UpdateLayout

    public class DynamicDrawableSpan
    extends android.text.style.ReplacementSpan
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static int ALIGN_BASELINE
      A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.
      static int ALIGN_BOTTOM
      A constant indicating that the bottom of this span should be aligned with the bottom of the surrounding text, i.e., at the same level as the lowest descender in the text.
      static int ALIGN_CENTER
      A constant indicating that this span should be vertically centered between the top and the lowest descender.
      static int ALIGN_TOP
      A constant indicating that this span should be vertically centered between the top and the lowest descender.
      protected int mVerticalAlignment  
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void draw​(android.graphics.Canvas canvas, java.lang.CharSequence text, int start, int end, float x, int top, int y, int bottom, android.graphics.Paint paint)  
      android.graphics.drawable.Drawable getDrawable()
      Your subclass must implement this method to provide the bitmap to be drawn.
      int getSize​(android.graphics.Paint paint, java.lang.CharSequence text, int start, int end, android.graphics.Paint.FontMetricsInt fm)  
      int getVerticalAlignment()
      Returns the vertical alignment of this span, one of ALIGN_BOTTOM, ALIGN_BASELINE or ALIGN_CENTER.
      • 从类继承的方法 android.text.style.ReplacementSpan

        getContentDescription, setContentDescription, updateDrawState, updateMeasureState
      • 从类继承的方法 android.text.style.MetricAffectingSpan

        getUnderlying
      • 从类继承的方法 android.text.style.CharacterStyle

        wrap
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • ALIGN_BOTTOM

        public static final int ALIGN_BOTTOM
        A constant indicating that the bottom of this span should be aligned with the bottom of the surrounding text, i.e., at the same level as the lowest descender in the text.
        另请参阅:
        常量字段值
      • ALIGN_BASELINE

        public static final int ALIGN_BASELINE
        A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.
        另请参阅:
        常量字段值
      • ALIGN_CENTER

        public static final int ALIGN_CENTER
        A constant indicating that this span should be vertically centered between the top and the lowest descender.
        另请参阅:
        常量字段值
      • ALIGN_TOP

        public static final int ALIGN_TOP
        A constant indicating that this span should be vertically centered between the top and the lowest descender.
        另请参阅:
        常量字段值
      • mVerticalAlignment

        protected final int mVerticalAlignment
    • 方法详细资料

      • getDrawable

        public android.graphics.drawable.Drawable getDrawable()
        Your subclass must implement this method to provide the bitmap to be drawn. The dimensions of the bitmap must be the same from each call to the next.
      • getSize

        public int getSize​(@NonNull
                           android.graphics.Paint paint,
                           java.lang.CharSequence text,
                           @IntRange(from=0L)
                           int start,
                           @IntRange(from=0L)
                           int end,
                           @Nullable
                           android.graphics.Paint.FontMetricsInt fm)
        指定者:
        getSize 在类中 android.text.style.ReplacementSpan
      • draw

        public void draw​(@NonNull
                         android.graphics.Canvas canvas,
                         java.lang.CharSequence text,
                         @IntRange(from=0L)
                         int start,
                         @IntRange(from=0L)
                         int end,
                         float x,
                         int top,
                         int y,
                         int bottom,
                         @NonNull
                         android.graphics.Paint paint)
        指定者:
        draw 在类中 android.text.style.ReplacementSpan