to top
Android APIs
public abstract class

DynamicDrawableSpan

extends ReplacementSpan
java.lang.Object
   ↳ android.text.style.CharacterStyle
     ↳ android.text.style.MetricAffectingSpan
       ↳ android.text.style.ReplacementSpan
         ↳ android.text.style.DynamicDrawableSpan
Known Direct Subclasses

Class Overview

Summary

Constants
int ALIGN_BASELINE A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.
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.
Fields
protected final int mVerticalAlignment
Public Constructors
DynamicDrawableSpan()
Protected Constructors
DynamicDrawableSpan(int verticalAlignment)
Public Methods
void draw(Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)
abstract Drawable getDrawable()
Your subclass must implement this method to provide the bitmap to be drawn.
int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)
int getVerticalAlignment()
Returns the vertical alignment of this span, one of ALIGN_BOTTOM or ALIGN_BASELINE.
[Expand]
Inherited Methods
From class android.text.style.ReplacementSpan
From class android.text.style.MetricAffectingSpan
From class android.text.style.CharacterStyle
From class java.lang.Object

Constants

public static final int ALIGN_BASELINE

Added in API level 3

A constant indicating that the bottom of this span should be aligned with the baseline of the surrounding text.

Constant Value: 1 (0x00000001)

public static final int ALIGN_BOTTOM

Added in API level 3

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.

Constant Value: 0 (0x00000000)

Fields

protected final int mVerticalAlignment

Added in API level 3

Public Constructors

public DynamicDrawableSpan ()

Added in API level 1

Protected Constructors

protected DynamicDrawableSpan (int verticalAlignment)

Added in API level 3

Parameters
verticalAlignment one of ALIGN_BOTTOM or ALIGN_BASELINE.

Public Methods

public void draw (Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom, Paint paint)

Added in API level 1

public abstract Drawable getDrawable ()

Added in API level 1

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.

public int getSize (Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm)

Added in API level 1

public int getVerticalAlignment ()

Added in API level 3

Returns the vertical alignment of this span, one of ALIGN_BOTTOM or ALIGN_BASELINE.