Class Overview
This class is used to specify meta information of a subtype contained in an input method.
Subtype can describe locale (e.g. en_US, fr_FR...) and mode (e.g. voice, keyboard...), and is
used for IME switch and settings. The input method subtype allows the system to bring up the
specified subtype of the designated input method directly.
Summary
Public Constructors |
|
InputMethodSubtype(int nameId, int iconId, String locale, String mode, String extraValue, boolean isAuxiliary, boolean overridesImplicitlyEnabledSubtype)
Constructor
|
Public Methods |
boolean
|
containsExtraValueKey(String key)
The string of ExtraValue in subtype should be defined as follows:
example: key0,key1=value1,key2,key3,key4=value4
|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
CharSequence
|
getDisplayName(Context context, String packageName, ApplicationInfo appInfo)
|
String
|
getExtraValue()
|
String
|
getExtraValueOf(String key)
The string of ExtraValue in subtype should be defined as follows:
example: key0,key1=value1,key2,key3,key4=value4
|
int
|
getIconResId()
|
String
|
getLocale()
|
String
|
getMode()
|
int
|
getNameResId()
|
int
|
hashCode()
Returns an integer hash code for this object.
|
boolean
|
isAuxiliary()
|
boolean
|
overridesImplicitlyEnabledSubtype()
|
void
|
writeToParcel(Parcel dest, int parcelableFlags)
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
From interface
android.os.Parcelable
abstract
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
abstract
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
|
|
Fields
Public Constructors
public
InputMethodSubtype
(int nameId, int iconId, String locale, String mode, String extraValue, boolean isAuxiliary, boolean overridesImplicitlyEnabledSubtype)
Parameters
nameId
| The name of the subtype |
iconId
| The icon of the subtype |
locale
| The locale supported by the subtype |
mode
| The mode supported by the subtype |
extraValue
| The extra value of the subtype |
isAuxiliary
| true when this subtype is one shot subtype. |
overridesImplicitlyEnabledSubtype
| true when this subtype should be selected by default
if no other subtypes are selected explicitly. Note that a subtype with this parameter being
true will not be shown in the subtypes list.
|
Public Methods
public
boolean
containsExtraValueKey
(String key)
The string of ExtraValue in subtype should be defined as follows:
example: key0,key1=value1,key2,key3,key4=value4
Parameters
key
| the key of extra value |
Returns
- the subtype contains specified the extra value
public
int
describeContents
()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
Returns
- a bitmask indicating the set of special object types marshalled
by the Parcelable.
public
boolean
equals
(Object o)
Compares this instance with the specified object and indicates if they
are equal. In order to be equal, o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
Parameters
o
| the object to compare this instance with. |
Returns
true
if the specified object is equal to this Object
; false
otherwise.
Parameters
context
| Context will be used for getting Locale and PackageManager. |
packageName
| The package name of the IME |
appInfo
| The application info of the IME |
Returns
- a display name for this subtype. The string resource of the label (mSubtypeNameResId)
can have only one %s in it. If there is, the %s part will be replaced with the locale's
display name by the formatter. If there is not, this method simply returns the string
specified by mSubtypeNameResId. If mSubtypeNameResId is not specified (== 0), it's up to the
framework to generate an appropriate display name.
public
String
getExtraValue
()
Returns
- the extra value of the subtype
public
String
getExtraValueOf
(String key)
The string of ExtraValue in subtype should be defined as follows:
example: key0,key1=value1,key2,key3,key4=value4
Parameters
key
| the key of extra value |
Returns
- the value of the specified key
public
int
getIconResId
()
public
String
getLocale
()
Returns
- the locale of the subtype
public
int
getNameResId
()
public
int
hashCode
()
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals
comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
public
boolean
isAuxiliary
()
Returns
- true if this subtype is one shot subtype. One shot subtype will not be shown in the
ime switch list when this subtype is implicitly enabled. The framework will never
switch the current ime to this subtype by switchToLastInputMethod in InputMethodManager.
public
boolean
overridesImplicitlyEnabledSubtype
()
Returns
- true when this subtype is selected by default if no other subtypes are selected
explicitly. Note that a subtype that returns true will not be shown in the subtypes list.
public
void
writeToParcel
(Parcel dest, int parcelableFlags)
Flatten this object in to a Parcel.
Parameters
dest
| The Parcel in which the object should be written. |
parcelableFlags
| Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|