public class LocaleSpan
extends MetricAffectingSpan
implements ParcelableSpan
java.lang.Object | |||
↳ | android.text.style.CharacterStyle | ||
↳ | android.text.style.MetricAffectingSpan | ||
↳ | android.text.style.LocaleSpan |
更改跨度所附文本的 Locale
。
Inherited constants |
---|
From interface android.os.Parcelable
|
Public constructors |
|
---|---|
LocaleSpan(Locale locale) 创建 |
|
LocaleSpan(LocaleList locales) 创建 |
|
LocaleSpan(Parcel source) |
Public methods |
|
---|---|
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
Locale |
getLocale() |
LocaleList |
getLocales() |
int |
getSpanTypeId() 返回此跨度类的特殊类型标识符。 |
void |
updateDrawState(TextPaint ds) |
void |
updateMeasureState(TextPaint paint) |
void |
writeToParcel(Parcel dest, int flags) 将此对象平铺到一个包裹中。 |
Inherited methods |
|
---|---|
From class android.text.style.MetricAffectingSpan
|
|
From class android.text.style.CharacterStyle
|
|
From class java.lang.Object
|
|
From interface android.text.ParcelableSpan
|
|
From interface android.os.Parcelable
|
LocaleSpan (Locale locale)
创建LocaleSpan
从井中形成Locale
。 请注意,只有Locale
可以通过以下方式创建对象forLanguageTag(String)
的支持。
警告:不要指定任何Locale
不能由创建对象forLanguageTag(String)
。 new Locale(" a ", " b c", " d")
是这种格式不正确的Locale
对象的示例。
Parameters | |
---|---|
locale |
Locale : The Locale of the text to which the span is attached. |
也可以看看:
LocaleSpan (LocaleList locales)
创建 LocaleSpan
从 LocaleList
。
Parameters | |
---|---|
locales |
LocaleList : The LocaleList of the text to which the span is attached. |
Throws | |
---|---|
NullPointerException |
if locales is null |
int describeContents ()
描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)
的输出中包含writeToParcel(Parcel, int)
,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR
位。
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
Locale getLocale ()
Returns | |
---|---|
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. |
LocaleList getLocales ()
Returns | |
---|---|
LocaleList |
The entire list of locales that are associated with this span. |
int getSpanTypeId ()
Return a special type identifier for this span class.
Returns | |
---|---|
int |
void updateMeasureState (TextPaint paint)
Parameters | |
---|---|
paint |
TextPaint
|
void writeToParcel (Parcel dest, int flags)
将此对象平铺到一个包裹中。
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
flags |
int : Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . |