LocaleSpan
open class LocaleSpan : MetricAffectingSpan, ParcelableSpan
| kotlin.Any | |||
| ↳ | android.text.style.CharacterStyle | ||
| ↳ | android.text.style.MetricAffectingSpan | ||
| ↳ | android.text.style.LocaleSpan | ||
Changes the Locale of the text to which the span is attached.
Summary
| Public constructors | |
|---|---|
LocaleSpan(locales: LocaleList)Creates a |
|
LocaleSpan(source: Parcel!) |
|
LocaleSpan(locale: Locale?)Creates a |
|
| Public methods | |
|---|---|
| open Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| open Locale? | |
| open LocaleList | |
| open Int |
Return a special type identifier for this span class. |
| open String |
toString()Returns a string representation of the object. |
| open Unit |
updateDrawState(ds: TextPaint!) |
| open Unit |
updateMeasureState(paint: TextPaint)Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters. |
| open Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Inherited functions | |
|---|---|
Public constructors
LocaleSpan
LocaleSpan(locales: LocaleList)
Creates a LocaleSpan from LocaleList.
| Parameters | |
|---|---|
locales |
LocaleList: The LocaleList of the text to which the span is attached. This value cannot be null. |
| Exceptions | |
|---|---|
java.lang.NullPointerException |
if locales is null |
LocaleSpan
LocaleSpan(locale: Locale?)
Creates a LocaleSpan from a well-formed Locale. Note that only Locale objects that can be created by Locale.forLanguageTag(String) are supported.
Caveat: Do not specify any Locale object that cannot be created by Locale.forLanguageTag(String). new Locale(" a ", " b c", " d") is an example of such a malformed Locale object.
| Parameters | |
|---|---|
locale |
Locale?: The Locale of the text to which the span is attached. This value may be null. |
See Also
Public methods
describeContents
open fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getLocale
open fun getLocale(): Locale?
| Return | |
|---|---|
Locale? |
The Locale for this span. If multiple locales are associated with this span, only the first locale is returned. null if no Locale is specified. |
getLocales
open fun getLocales(): LocaleList
| Return | |
|---|---|
LocaleList |
The entire list of locales that are associated with this span. This value cannot be null. |
getSpanTypeId
open fun getSpanTypeId(): Int
Return a special type identifier for this span class.
toString
open fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
updateMeasureState
open fun updateMeasureState(paint: TextPaint): Unit
Classes that extend MetricAffectingSpan implement this method to update the text formatting in a way that can change the width or height of characters.
| Parameters | |
|---|---|
textPaint |
the paint used for drawing the text. This value cannot be null. |
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|