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
Object clone()
Creates and returns a copy of this Object.
boolean equals(Object o)
Compares this instance with the specified object and indicates if they are equal.
void finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
final Class<?> getClass()
Returns the unique instance of Class that represents this object's class.
int hashCode()
Returns an integer hash code for this object.
final void notify()
Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.
final void notifyAll()
Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.
String toString()
Returns a string containing a concise, human-readable description of this object.
final void wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
final void wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.
final void wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

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.