Package icyllis.modernui.text.style
Class LocaleSpan
java.lang.Object
icyllis.modernui.text.style.CharacterStyle
icyllis.modernui.text.style.MetricAffectingSpan
icyllis.modernui.text.style.LocaleSpan
- All Implemented Interfaces:
icyllis.modernui.text.ParcelableSpan,UpdateAppearance,UpdateLayout,Parcelable,Cloneable
Changes the
Locale of the text to which the span is attached.-
Nested Class Summary
Nested classes/interfaces inherited from interface icyllis.modernui.util.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>, Parcelable.WriteFlags -
Constructor Summary
ConstructorsConstructorDescriptionLocaleSpan(Parcel source) LocaleSpan(Locale locale) Creates aLocaleSpanfrom a well-formedLocale. -
Method Summary
Modifier and TypeMethodDescriptionintReturn a special type identifier for this span class.voidupdateMeasureState(TextPaint paint) Classes that extendMetricAffectingSpanimplement this method to update the text formatting in a way that can change the width or height of characters.voidwriteToParcel(Parcel dest, int flags) The subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.Methods inherited from class icyllis.modernui.text.style.MetricAffectingSpan
updateDrawStateMethods inherited from class icyllis.modernui.text.style.CharacterStyle
clone, wrap
-
Constructor Details
-
LocaleSpan
Creates aLocaleSpanfrom a well-formedLocale. Note that onlyLocaleobjects that can be created byLocale.forLanguageTag(String)are supported.Caveat: Do not specify any
Localeobject that cannot be created byLocale.forLanguageTag(String).new Locale(" a ", " b c", " d")is an example of such a malformedLocaleobject.- Parameters:
locale- TheLocaleof the text to which the span is attached.
-
LocaleSpan
-
-
Method Details
-
getSpanTypeId
public int getSpanTypeId()Return a special type identifier for this span class.- Specified by:
getSpanTypeIdin interfaceicyllis.modernui.text.ParcelableSpan
-
writeToParcel
Description copied from interface:ParcelableThe subclass implements the method to flatten its contents by calling the methods ofParcelfor its primitive values.- Specified by:
writeToParcelin interfaceParcelable- Parameters:
dest- the parcel to write the object's data toflags- the flags about how the object should be written
-
updateMeasureState
Description copied from class:MetricAffectingSpanClasses that extendMetricAffectingSpanimplement this method to update the text formatting in a way that can change the width or height of characters.- Specified by:
updateMeasureStatein classMetricAffectingSpan- Parameters:
paint- the paint used for measuring the text
-
getLocale
-