Skip to content

Most visited

Recently visited

navigation
Added in API level 1

CharacterStyle

public abstract class CharacterStyle
extends Object

java.lang.Object
   ↳ android.text.style.CharacterStyle
Known Direct Subclasses
Known Indirect Subclasses


The classes that affect character-level text formatting extend this class. Most extend its subclass MetricAffectingSpan, but simple ones may just implement UpdateAppearance.

Summary

Public constructors

CharacterStyle()

Public 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.

Inherited methods

From class java.lang.Object

Public constructors

CharacterStyle

Added in API level 1
CharacterStyle ()

Public methods

getUnderlying

Added in API level 1
CharacterStyle getUnderlying ()

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

Returns
CharacterStyle

updateDrawState

Added in API level 1
void updateDrawState (TextPaint tp)

Parameters
tp TextPaint

wrap

Added in API level 1
CharacterStyle wrap (CharacterStyle cs)

A given CharacterStyle can only applied to a single region of a given Spanned. If you need to attach the same CharacterStyle to multiple regions, you can use this method to wrap it with a new object that will have the same effect but be a distinct object so that it can also be attached without conflict.

Parameters
cs CharacterStyle
Returns
CharacterStyle
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.