CharacterStyle.javaAPI DocAndroid 5.1 API2957Thu Mar 12 22:22:10 GMT


public abstract class CharacterStyle extends Object
The classes that affect character-level text formatting extend this class. Most extend its subclass {@link MetricAffectingSpan}, but simple ones may just implement {@link UpdateAppearance}.

Fields Summary
Constructors Summary
Methods Summary
Returns "this" for most CharacterStyles, but for CharacterStyles that were generated by {@link #wrap}, returns the underlying CharacterStyle.

        return this;
public abstract voidupdateDrawState(android.text.TextPaint tp)

public static 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.

        if (cs instanceof MetricAffectingSpan) {
            return new MetricAffectingSpan.Passthrough((MetricAffectingSpan) cs);
        } else {
            return new Passthrough(cs);