Build 1.0_r1(from source)

android.text.style
Class TextAppearanceSpan

java.lang.Object
  extended by android.text.style.CharacterStyle
      extended by android.text.style.MetricAffectingSpan
          extended by android.text.style.TextAppearanceSpan
All Implemented Interfaces:
UpdateLayout

public class TextAppearanceSpan
extends MetricAffectingSpan

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


Nested Class Summary
 
Nested classes/interfaces inherited from class android.text.style.MetricAffectingSpan
MetricAffectingSpan.Passthrough
 
Constructor Summary
TextAppearanceSpan(Context context, int appearance)
          Uses the specified TextAppearance resource to determine the text appearance.
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.
TextAppearanceSpan(String family, int style, int size, ColorStateList color, ColorStateList linkColor)
          Makes text be drawn with the specified typeface, size, style, and colors.
 
Method Summary
 String getFamily()
          Returns the typeface family specified by this span, or null if it does not specify one.
 ColorStateList getLinkTextColor()
          Returns the link color specified by this span, or null if it does not specify one.
 ColorStateList getTextColor()
          Returns the text color specified by this span, or null if it does not specify one.
 int getTextSize()
          Returns the text size specified by this span, or -1 if it does not specify one.
 int getTextStyle()
          Returns the text style specified by this span, or 0 if it does not specify one.
 void updateDrawState(TextPaint ds)
           
 void updateMeasureState(TextPaint ds)
           
 
Methods inherited from class android.text.style.MetricAffectingSpan
getUnderlying
 
Methods inherited from class android.text.style.CharacterStyle
wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextAppearanceSpan

public TextAppearanceSpan(Context context,
                          int appearance)
Uses the specified TextAppearance resource to determine the text appearance. The appearance should be, for example, android.R.style.TextAppearance_Small.


TextAppearanceSpan

public 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. The appearance should be, for example, android.R.style.TextAppearance_Small, and the colorList should be, for example, android.R.styleable.Theme_textColorDim.


TextAppearanceSpan

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

Method Detail

getFamily

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


getTextColor

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


getLinkTextColor

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


getTextSize

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


getTextStyle

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


updateDrawState

public void updateDrawState(TextPaint ds)
Specified by:
updateDrawState in class CharacterStyle

updateMeasureState

public void updateMeasureState(TextPaint ds)
Specified by:
updateMeasureState in class MetricAffectingSpan

Build 1.0_r1(from source)

Please submit a feedback, bug or feature