类 DynamicDrawableSpan
- java.lang.Object
-
- android.text.style.CharacterStyle
-
- android.text.style.MetricAffectingSpan
-
- android.text.style.ReplacementSpan
-
- io.agora.chat.uikit.widget.DynamicDrawableSpan
-
- 所有已实现的接口:
android.text.style.UpdateAppearance,android.text.style.UpdateLayout
public class DynamicDrawableSpan extends android.text.style.ReplacementSpan
-
-
字段概要
字段 修饰符和类型 字段 说明 static intALIGN_BASELINEA constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.static intALIGN_BOTTOMA 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 intALIGN_CENTERA constant indicating that this span should be vertically centered between the top and the lowest descender.static intALIGN_TOPA constant indicating that this span should be vertically centered between the top and the lowest descender.protected intmVerticalAlignment
-
构造器概要
构造器 限定符 构造器 说明 DynamicDrawableSpan()Creates aDynamicDrawableSpan.protectedDynamicDrawableSpan(int verticalAlignment)Creates aDynamicDrawableSpanbased on a vertical alignmentDynamicDrawableSpan(android.graphics.drawable.Drawable drawable)Creates aDynamicDrawableSpan.protectedDynamicDrawableSpan(android.graphics.drawable.Drawable drawable, int verticalAlignment)Creates aDynamicDrawableSpanbased on a vertical alignment
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddraw(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.DrawablegetDrawable()Your subclass must implement this method to provide the bitmap to be drawn.intgetSize(android.graphics.Paint paint, java.lang.CharSequence text, int start, int end, android.graphics.Paint.FontMetricsInt fm)intgetVerticalAlignment()
-
-
-
字段详细资料
-
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
-
-
构造器详细资料
-
DynamicDrawableSpan
public DynamicDrawableSpan()
Creates aDynamicDrawableSpan. The default vertical alignment isALIGN_BOTTOM
-
DynamicDrawableSpan
public DynamicDrawableSpan(android.graphics.drawable.Drawable drawable)
Creates aDynamicDrawableSpan. The default vertical alignment isALIGN_BOTTOM
-
DynamicDrawableSpan
protected DynamicDrawableSpan(int verticalAlignment)
Creates aDynamicDrawableSpanbased on a vertical alignment.\- 参数:
verticalAlignment- one ofALIGN_BOTTOM,ALIGN_BASELINEorALIGN_CENTER
-
DynamicDrawableSpan
protected DynamicDrawableSpan(android.graphics.drawable.Drawable drawable, int verticalAlignment)Creates aDynamicDrawableSpanbased on a vertical alignment.\- 参数:
verticalAlignment- one ofALIGN_BOTTOM,ALIGN_BASELINEorALIGN_CENTER
-
-
方法详细资料
-
getVerticalAlignment
public int getVerticalAlignment()
-
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
-
-