Skip to content

Most visited

Recently visited

navigation
Added in API level 1

DynamicDrawableSpan

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


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.

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

ALIGN_BASELINE

Added in API level 3
int ALIGN_BASELINE

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

Constant Value: 1 (0x00000001)

ALIGN_BOTTOM

Added in API level 3
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.

Constant Value: 0 (0x00000000)

Fields

mVerticalAlignment

Added in API level 3
int mVerticalAlignment

Public constructors

DynamicDrawableSpan

Added in API level 1
DynamicDrawableSpan ()

Protected constructors

DynamicDrawableSpan

Added in API level 3
DynamicDrawableSpan (int verticalAlignment)

Parameters
verticalAlignment int: one of ALIGN_BOTTOM or ALIGN_BASELINE.

Public methods

draw

Added in API level 1
void draw (Canvas canvas, 
                CharSequence text, 
                int start, 
                int end, 
                float x, 
                int top, 
                int y, 
                int bottom, 
                Paint paint)

Parameters
canvas Canvas
text CharSequence
start int
end int
x float
top int
y int
bottom int
paint Paint

getDrawable

Added in API level 1
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.

Returns
Drawable

getSize

Added in API level 1
int getSize (Paint paint, 
                CharSequence text, 
                int start, 
                int end, 
                Paint.FontMetricsInt fm)

Parameters
paint Paint
text CharSequence
start int
end int
fm Paint.FontMetricsInt
Returns
int

getVerticalAlignment

Added in API level 3
int getVerticalAlignment ()

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

Returns
int
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.