Added in API level 19

InputMethodSubtypeBuilder


class InputMethodSubtypeBuilder
kotlin.Any
   ↳ android.view.inputmethod.InputMethodSubtype.InputMethodSubtypeBuilder

InputMethodSubtypeBuilder is a builder class of InputMethodSubtype. This class is designed to be used with android.view.inputmethod.InputMethodManager#setAdditionalInputMethodSubtypes. The developer needs to be aware of what each parameter means.

Summary

Public constructors

Public methods
open InputMethodSubtype!

open InputMethodSubtype.InputMethodSubtypeBuilder!
setIsAsciiCapable(isAsciiCapable: Boolean)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setIsAuxiliary(isAuxiliary: Boolean)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setLanguageTag(languageTag: String!)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setOverridesImplicitlyEnabledSubtype(overridesImplicitlyEnabledSubtype: Boolean)

open InputMethodSubtype.InputMethodSubtypeBuilder
setPhysicalKeyboardHint(languageTag: ULocale?, layoutType: String)

Sets the physical keyboard hint information, such as language and layout.

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeExtraValue(subtypeExtraValue: String!)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeIconResId(subtypeIconResId: Int)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeId(subtypeId: Int)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeLocale(subtypeLocale: String!)

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeMode(subtypeMode: String!)

open InputMethodSubtype.InputMethodSubtypeBuilder

Sets the untranslatable name of the subtype.

open InputMethodSubtype.InputMethodSubtypeBuilder!
setSubtypeNameResId(subtypeNameResId: Int)

Public constructors

InputMethodSubtypeBuilder

InputMethodSubtypeBuilder()

Public methods

build

Added in API level 19
open fun build(): InputMethodSubtype!
Return
InputMethodSubtype! InputMethodSubtype using parameters in this InputMethodSubtypeBuilder.

setIsAsciiCapable

Added in API level 19
open fun setIsAsciiCapable(isAsciiCapable: Boolean): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
isAsciiCapable Boolean: should be true if this subtype is ASCII capable. If the subtype is ASCII capable, it should guarantee that the user can input ASCII characters with this subtype. This is important because many password fields only allow ASCII-characters.

setIsAuxiliary

Added in API level 19
open fun setIsAuxiliary(isAuxiliary: Boolean): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
isAuxiliary Boolean: should true when this subtype is auxiliary, false otherwise. An auxiliary subtype has the following differences with a regular subtype: - An auxiliary subtype cannot be chosen as the default IME in Settings. - The framework will never switch to this subtype through android.view.inputmethod.InputMethodManager#switchToLastInputMethod. Note that the subtype will still be available in the IME switcher. The intent is to allow for IMEs to specify they are meant to be invoked temporarily in a one-shot way, and to return to the previous IME once finished (e.g. voice input).

setLanguageTag

Added in API level 24
open fun setLanguageTag(languageTag: String!): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
languageTag String!: is the BCP-47 Language Tag supported by this subtype.

setOverridesImplicitlyEnabledSubtype

Added in API level 19
open fun setOverridesImplicitlyEnabledSubtype(overridesImplicitlyEnabledSubtype: Boolean): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
overridesImplicitlyEnabledSubtype Boolean: should be true if this subtype should be enabled by default if no other subtypes in the IME are enabled explicitly. Note that a subtype with this parameter set will not be shown in the list of subtypes in each IME's subtype enabler. A canonical use of this would be for an IME to supply an "automatic" subtype that adapts to the current system language.

setPhysicalKeyboardHint

Added in API level 34
open fun setPhysicalKeyboardHint(
    languageTag: ULocale?,
    layoutType: String
): InputMethodSubtype.InputMethodSubtypeBuilder

Sets the physical keyboard hint information, such as language and layout. The system can use the hint information to automatically configure the physical keyboard for the subtype.

Parameters
languageTag ULocale?: is the preferred physical keyboard BCP-47 language tag. This is used to match the keyboardLocale attribute in the physical keyboard definition. If it's null, the subtype's language tag will be used.
layoutType String: is the preferred physical keyboard layout, which is used to match the keyboardLayoutType attribute in the physical keyboard definition. See android.hardware.input.InputManager#ACTION_QUERY_KEYBOARD_LAYOUTS. This value cannot be null.
Return
InputMethodSubtype.InputMethodSubtypeBuilder This value cannot be null.

setSubtypeExtraValue

Added in API level 19
open fun setSubtypeExtraValue(subtypeExtraValue: String!): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeExtraValue String!: is the extra value of the subtype. This string is free-form, but the API supplies tools to deal with a key-value comma-separated list; see containsExtraValueKey and getExtraValueOf.

setSubtypeIconResId

Added in API level 19
open fun setSubtypeIconResId(subtypeIconResId: Int): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeIconResId Int: is a resource ID of the subtype icon drawable.

setSubtypeId

Added in API level 19
open fun setSubtypeId(subtypeId: Int): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeId Int: is the unique ID for this subtype. The input method framework keeps track of enabled subtypes by ID. When the IME package gets upgraded, enabled IDs will stay enabled even if other attributes are different. If the ID is unspecified or 0, Arrays.hashCode(new Object[] {locale, mode, extraValue, isAuxiliary, overridesImplicitlyEnabledSubtype, isAsciiCapable}) will be used instead.

setSubtypeLocale

Added in API level 19
open fun setSubtypeLocale(subtypeLocale: String!): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeLocale String!: is the locale supported by this subtype.

setSubtypeMode

Added in API level 19
open fun setSubtypeMode(subtypeMode: String!): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeMode String!: is the mode supported by this subtype.

setSubtypeNameOverride

Added in API level 34
open fun setSubtypeNameOverride(nameOverride: CharSequence): InputMethodSubtype.InputMethodSubtypeBuilder

Sets the untranslatable name of the subtype. This string is used as the subtype's display name if subtype's name res Id is 0.

Parameters
nameOverride CharSequence: is the name to set. This value cannot be null.
Return
InputMethodSubtype.InputMethodSubtypeBuilder This value cannot be null.

setSubtypeNameResId

Added in API level 19
open fun setSubtypeNameResId(subtypeNameResId: Int): InputMethodSubtype.InputMethodSubtypeBuilder!
Parameters
subtypeNameResId Int: is the resource ID of the subtype name string. The string resource may have exactly one %s in it. If present, the %s part will be replaced with the locale's display name by the formatter. Please refer to getDisplayName for details.