FileDocCategorySizeDatePackage
AbsoluteSizeSpan.javaAPI DocAndroid 5.1 API2255Thu Mar 12 22:22:10 GMT 2015android.text.style

AbsoluteSizeSpan

public class AbsoluteSizeSpan extends MetricAffectingSpan implements android.text.ParcelableSpan

Fields Summary
private final int
mSize
private boolean
mDip
Constructors Summary
public AbsoluteSizeSpan(int size)
Set the text size to size physical pixels.

        mSize = size;
    
public AbsoluteSizeSpan(int size, boolean dip)
Set the text size to size physical pixels, or to size device-independent pixels if dip is true.

        mSize = size;
        mDip = dip;
    
public AbsoluteSizeSpan(android.os.Parcel src)

        mSize = src.readInt();
        mDip = src.readInt() != 0;
    
Methods Summary
public intdescribeContents()

        return 0;
    
public booleangetDip()

        return mDip;
    
public intgetSize()

        return mSize;
    
public intgetSpanTypeId()

        return TextUtils.ABSOLUTE_SIZE_SPAN;
    
public voidupdateDrawState(android.text.TextPaint ds)

        if (mDip) {
            ds.setTextSize(mSize * ds.density);
        } else {
            ds.setTextSize(mSize);
        }
    
public voidupdateMeasureState(android.text.TextPaint ds)

        if (mDip) {
            ds.setTextSize(mSize * ds.density);
        } else {
            ds.setTextSize(mSize);
        }
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeInt(mSize);
        dest.writeInt(mDip ? 1 : 0);