Added in API level 1

MetricAffectingSpan


public abstract class MetricAffectingSpan
extends CharacterStyle implements UpdateLayout

java.lang.Object
   ↳ android.text.style.CharacterStyle
     ↳ android.text.style.MetricAffectingSpan
AbsoluteSizeSpan A span that changes the size of the text it's attached to. 
LocaleSpan Changes the Locale of the text to which the span is attached. 
RelativeSizeSpan Uniformly scales the size of the text to which it's attached by a certain proportion. 
ReplacementSpan  
ScaleXSpan Scales horizontally the size of the text to which it's attached by a certain factor. 
StyleSpan Span that allows setting the style of the text it's attached to. 
SubscriptSpan The span that moves the position of the text baseline lower. 
SuperscriptSpan The span that moves the position of the text baseline higher. 
TextAppearanceSpan Sets the text appearance using the given TextAppearance attributes. 
TypefaceSpan Span that updates the typeface of the text it's attached to. 
DynamicDrawableSpan Span that replaces the text it's attached to with a Drawable that can be aligned with the bottom or with the baseline of the surrounding text. 
ImageSpan Span that replaces the text it's attached to with a Drawable that can be aligned with the bottom or with the baseline of the surrounding text. 


The classes that affect character-level text formatting in a way that changes the width or height of characters extend this class.

Summary

Public constructors

MetricAffectingSpan()

Public methods

MetricAffectingSpan getUnderlying()

Returns "this" for most MetricAffectingSpans, but for MetricAffectingSpans that were generated by CharacterStyle.wrap(CharacterStyle), returns the underlying MetricAffectingSpan.

abstract void updateMeasureState(TextPaint textPaint)

Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.

Inherited methods

CharacterStyle getUnderlying()

Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by wrap(CharacterStyle), returns the underlying CharacterStyle.

abstract void updateDrawState(TextPaint tp)
static CharacterStyle wrap(CharacterStyle cs)

A given CharacterStyle can only applied to a single region of a given Spanned.

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

MetricAffectingSpan

public MetricAffectingSpan ()

Public methods

getUnderlying

Added in API level 1
public MetricAffectingSpan getUnderlying ()

Returns "this" for most MetricAffectingSpans, but for MetricAffectingSpans that were generated by CharacterStyle.wrap(CharacterStyle), returns the underlying MetricAffectingSpan.

updateMeasureState

Added in API level 1
public abstract void updateMeasureState (TextPaint textPaint)

Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.

Parameters
textPaint TextPaint: the paint used for drawing the text This value cannot be null.