to top
Android APIs
public class

TextAppearanceSpan

extends MetricAffectingSpan
implements ParcelableSpan
java.lang.Object
   ↳ android.text.style.CharacterStyle
     ↳ android.text.style.MetricAffectingSpan
       ↳ android.text.style.TextAppearanceSpan

Class Overview

Sets the text color, size, style, and typeface to match a TextAppearance resource.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Constructors

? Examples
TextAppearanceSpan( Context context, int appearance)
Uses the specified TextAppearance resource to determine the text appearance.

? Examples
TextAppearanceSpan( Context context, int appearance, int colorList)
Uses the specified TextAppearance resource to determine the text appearance, and the specified text color resource to determine the color.

? Examples
TextAppearanceSpan( String family, int style, int size, ColorStateList color, ColorStateList linkColor)
Makes text be drawn with the specified typeface, size, style, and colors.

? Examples
TextAppearanceSpan( Parcel src)
Public Methods

? Examples
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.

? Examples
String getFamily()
Returns the typeface family specified by this span, or null if it does not specify one.

? Examples
ColorStateList getLinkTextColor()
Returns the link color specified by this span, or null if it does not specify one.

? Examples
int getSpanTypeId()
Return a special type identifier for this span class.

? Examples
ColorStateList getTextColor()
Returns the text color specified by this span, or null if it does not specify one.

? Examples
int getTextSize()
Returns the text size specified by this span, or -1 if it does not specify one.

? Examples
int getTextStyle()
Returns the text style specified by this span, or 0 if it does not specify one.

? Examples
void updateDrawState( TextPaint ds)

? Examples
void updateMeasureState( TextPaint ds)

? Examples
void writeToParcel( Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class android.text.style.MetricAffectingSpan
From class android.text.style.CharacterStyle
From class java.lang.Object
From interface android.os.Parcelable
From interface android.text.ParcelableSpan

Public Constructors

public TextAppearanceSpan (Context context, int appearance)

Added in API level 1

Uses the specified TextAppearance resource to determine the text appearance. The appearance should be, for example, android.R.style.TextAppearance_Small.

public TextAppearanceSpan (Context context, int appearance, int colorList)

Added in API level 1

Uses the specified TextAppearance resource to determine the text appearance, and the specified text color resource to determine the color. The appearance should be, for example, android.R.style.TextAppearance_Small, and the colorList should be, for example, android.R.styleable.Theme_textColorPrimary.

public TextAppearanceSpan (String family, int style, int size, ColorStateList color, ColorStateList linkColor)

Added in API level 1

Makes text be drawn with the specified typeface, size, style, and colors.

public TextAppearanceSpan (Parcel src)

Added in API level 3

Public Methods

public int describeContents ()

Added in API level 3

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public String getFamily ()

Added in API level 1

Returns the typeface family specified by this span, or null if it does not specify one.

public ColorStateList getLinkTextColor ()

Added in API level 1

Returns the link color specified by this span, or null if it does not specify one.

public int getSpanTypeId ()

Added in API level 3

Return a special type identifier for this span class.

public ColorStateList getTextColor ()

Added in API level 1

Returns the text color specified by this span, or null if it does not specify one.

public int getTextSize ()

Added in API level 1

Returns the text size specified by this span, or -1 if it does not specify one.

public int getTextStyle ()

Added in API level 1

Returns the text style specified by this span, or 0 if it does not specify one.

public void updateDrawState (TextPaint ds)

Added in API level 1

public void updateMeasureState (TextPaint ds)

Added in API level 1

public void writeToParcel (Parcel dest, int flags)

Added in API level 3

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.