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 |
|---|
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) |
|
|---|---|
android.text.style.MetricAffectingSpan
|
|
android.text.style.CharacterStyle
|
|
java.lang.Object
|
|
android.text.ParcelableSpan
|
|
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 updateDrawState (TextPaint ds)
| 参数(Parameters) | |
|---|---|
ds |
TextPaint
|
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. |