InputMethodInfo
class InputMethodInfo : Parcelable
| kotlin.Any | |
| ↳ | android.view.inputmethod.InputMethodInfo |
This class is used to specify meta information of an input method.
It should be defined in an XML resource file with an <input-method> element. For more information, see the guide to Creating an Input Method.
Summary
XML attributes |
|
|---|---|
android:isDefault |
Set to true in all of the configurations for which this input method should be considered an option as the default. |
android:settingsActivity |
Component name of an activity that allows the user to modify the settings for this service. |
android:supportsInlineSuggestions |
Specifies whether the IME supports showing inline suggestions. |
android:supportsSwitchingToNextInputMethod |
Set to true if this input method supports ways to switch to a next input method (for example, a globe key.). |
Inherited constants |
|
|---|---|
Public constructors |
|
|---|---|
<init>(context: Context!, service: ResolveInfo!)Constructor. |
|
<init>(packageName: String!, className: String!, label: CharSequence!, settingsActivity: String!)Temporary API for creating a built-in input method for test. |
|
Public methods |
|
|---|---|
| Int | |
| Unit | |
| Boolean |
Used to test whether the given parameter object is an |
| ComponentName! |
Return the component of the service that implements this input method. |
| String! |
getId()Return a unique ID for this input method. |
| Int |
Return the resource identifier of a resource inside of this input method's . |
| String! |
Return the . |
| ServiceInfo! |
Return the raw information about the Service implementing this input method. |
| String! |
Return the class name of the service component that implements this input method. |
| String! |
Return the class name of an activity that provides a settings UI for the input method. |
| InputMethodSubtype! |
getSubtypeAt(index: Int)Return the Input Method's subtype at the specified index. |
| Int |
Return the count of the subtypes of Input Method. |
| Int |
hashCode() |
| Drawable! |
loadIcon(pm: PackageManager!)Load the user-displayed icon for this input method. |
| CharSequence! |
loadLabel(pm: PackageManager!)Load the user-displayed label for this input method. |
| String |
toString() |
| Unit |
writeToParcel(dest: Parcel!, flags: Int)Used to package this object into a |
Properties |
|
|---|---|
| static Parcelable.Creator<InputMethodInfo!> |
Used to make this class parcelable. |
XML attributes
android:isDefault
android:isDefault
Set to true in all of the configurations for which this input method should be considered an option as the default.
May be a boolean value, such as "true" or "false".
android:settingsActivity
android:settingsActivity
Component name of an activity that allows the user to modify the settings for this service.
May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;
android:supportsInlineSuggestions
android:supportsInlineSuggestions
Specifies whether the IME supports showing inline suggestions.
May be a boolean value, such as "true" or "false".
android:supportsSwitchingToNextInputMethod
android:supportsSwitchingToNextInputMethod
Set to true if this input method supports ways to switch to a next input method (for example, a globe key.). When this is true and InputMethodManager#shouldOfferSwitchingToNextInputMethod() returns true, the IME has to offer ways to invoke InputMethodManager#switchToNextInputMethod() accordingly.
Note that the system determines the most appropriate next input method and subtype in order to provide the consistent user experience in switching between IMEs and subtypes.
May be a boolean value, such as "true" or "false".
Public constructors
<init>
InputMethodInfo(
context: Context!,
service: ResolveInfo!)
Constructor.
| Parameters | |
|---|---|
context |
Context!: The Context in which we are parsing the input method. |
service |
ResolveInfo!: The ResolveInfo returned from the package manager about this input method's component. |
<init>
InputMethodInfo(
packageName: String!,
className: String!,
label: CharSequence!,
settingsActivity: String!)
Temporary API for creating a built-in input method for test.
Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Used to test whether the given parameter object is an InputMethodInfo and its Id is the same to this one.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if the given parameter object is an InputMethodInfo and its Id is the same to this one. |
getComponent
fun getComponent(): ComponentName!
Return the component of the service that implements this input method.
getId
fun getId(): String!
Return a unique ID for this input method. The ID is generated from the package and class name implementing the method.
getIsDefaultResourceId
fun getIsDefaultResourceId(): Int
Return the resource identifier of a resource inside of this input method's .apk that determines whether it should be considered a default input method for the system.
getPackageName
fun getPackageName(): String!
Return the .apk package that implements this input method.
getServiceInfo
fun getServiceInfo(): ServiceInfo!
Return the raw information about the Service implementing this input method. Do not modify the returned object.
getServiceName
fun getServiceName(): String!
Return the class name of the service component that implements this input method.
getSettingsActivity
fun getSettingsActivity(): String!
Return the class name of an activity that provides a settings UI for the input method. You can launch this activity be starting it with an android.content.Intent whose action is MAIN and with an explicit android.content.ComponentName composed of getPackageName and the class name returned here.
A null will be returned if there is no settings activity associated with the input method.
getSubtypeAt
fun getSubtypeAt(index: Int): InputMethodSubtype!
Return the Input Method's subtype at the specified index.
| Parameters | |
|---|---|
index |
Int: the index of the subtype to return. |
getSubtypeCount
fun getSubtypeCount(): Int
Return the count of the subtypes of Input Method.
loadIcon
fun loadIcon(pm: PackageManager!): Drawable!
Load the user-displayed icon for this input method.
| Parameters | |
|---|---|
pm |
PackageManager!: Supply a PackageManager used to load the input method's resources. |
loadLabel
fun loadLabel(pm: PackageManager!): CharSequence!
Load the user-displayed label for this input method.
| Parameters | |
|---|---|
pm |
PackageManager!: Supply a PackageManager used to load the input method's resources. |
toString
fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel!,
flags: Int
): Unit
Used to package this object into a Parcel.
| Parameters | |
|---|---|
dest |
Parcel!: The Parcel to be written. |
flags |
Int: The flags used for parceling. |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<InputMethodInfo!>
Used to make this class parcelable.