FileDocCategorySizeDatePackage
LocaleSpan.javaAPI DocAndroid 5.1 API2228Thu Mar 12 22:22:10 GMT 2015android.text.style

LocaleSpan

public class LocaleSpan extends MetricAffectingSpan implements android.text.ParcelableSpan
Changes the {@link Locale} of the text to which the span is attached.

Fields Summary
private final Locale
mLocale
Constructors Summary
public LocaleSpan(Locale locale)
Creates a LocaleSpan.

param
locale The {@link Locale} of the text to which the span is attached.

        mLocale = locale;
    
public LocaleSpan(android.os.Parcel src)

        mLocale = new Locale(src.readString(), src.readString(), src.readString());
    
Methods Summary
private static voidapply(android.graphics.Paint paint, java.util.Locale locale)

        paint.setTextLocale(locale);
    
public intdescribeContents()

        return 0;
    
public java.util.LocalegetLocale()
Returns the {@link Locale}.

return
The {@link Locale} for this span.

        return mLocale;
    
public intgetSpanTypeId()

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

        apply(ds, mLocale);
    
public voidupdateMeasureState(android.text.TextPaint paint)

        apply(paint, mLocale);
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeString(mLocale.getLanguage());
        dest.writeString(mLocale.getCountry());
        dest.writeString(mLocale.getVariant());