ImeOptions


The IME configuration options for TextInputService. It is not guaranteed if IME will comply with the options provided here.

Summary

Public companion properties

ImeOptions

Default ImeOptions.

Cmn

Public constructors

ImeOptions(
    singleLine: Boolean,
    capitalization: KeyboardCapitalization,
    autoCorrect: Boolean,
    keyboardType: KeyboardType,
    imeAction: ImeAction,
    platformImeOptions: PlatformImeOptions?,
    hintLocales: LocaleList
)
Cmn

Public functions

ImeOptions
copy(
    singleLine: Boolean,
    capitalization: KeyboardCapitalization,
    autoCorrect: Boolean,
    keyboardType: KeyboardType,
    imeAction: ImeAction,
    platformImeOptions: PlatformImeOptions?,
    hintLocales: LocaleList
)
Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

Boolean

informs the IME whether to enable auto correct.

Cmn
KeyboardCapitalization

informs the IME whether to automatically capitalize characters, words or sentences.

Cmn
LocaleList

List of the languages that the user is supposed to switch to no matter what input method subtype is currently used.

Cmn
ImeAction

The IME action.

Cmn
KeyboardType

The keyboard type to be used in this text field.

Cmn
PlatformImeOptions?

defines the platform specific IME options.

Cmn
Boolean

informs the IME that the text field is single line and IME should not show return key.

Cmn

Public companion properties

Default

val DefaultImeOptions

Default ImeOptions. Please see parameter descriptions for default values.

Public constructors

ImeOptions

ImeOptions(
    singleLine: Boolean = false,
    capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
    autoCorrect: Boolean = true,
    keyboardType: KeyboardType = KeyboardType.Text,
    imeAction: ImeAction = ImeAction.Default,
    platformImeOptions: PlatformImeOptions? = null,
    hintLocales: LocaleList = LocaleList.Empty
)
Parameters
singleLine: Boolean = false

informs the IME that the text field is single line and IME should not show return key.

capitalization: KeyboardCapitalization = KeyboardCapitalization.None

informs the IME whether to automatically capitalize characters, words or sentences. Only applicable to only text based KeyboardTypes such as KeyboardType.Text, KeyboardType.Ascii. It will not be applied to KeyboardTypes such as KeyboardType.Number or KeyboardType.Decimal.

autoCorrect: Boolean = true

informs the IME whether to enable auto correct. Only applicable to text based KeyboardTypes such as KeyboardType.Email, KeyboardType.Uri. It will not be applied to KeyboardTypes such as KeyboardType.Number or KeyboardType.Decimal. Most of IME implementations ignore this value for KeyboardTypes such as KeyboardType.Text.

keyboardType: KeyboardType = KeyboardType.Text

The keyboard type to be used in this text field. Note that this input type is honored by IME and shows corresponding keyboard but this is not guaranteed. For example, some IME may send non-ASCII character even if you set KeyboardType.Ascii.

imeAction: ImeAction = ImeAction.Default

The IME action. This IME action is honored by IME and may show specific icons on the keyboard. For example, search icon may be shown if ImeAction.Search is specified. When singleLine is false, the IME might show return key rather than the action requested here.

platformImeOptions: PlatformImeOptions? = null

defines the platform specific IME options.

hintLocales: LocaleList = LocaleList.Empty

List of the languages that the user is supposed to switch to no matter what input method subtype is currently used. This special "hint" can be used mainly for, but not limited to, multilingual users who want IMEs to switch language based on editor's context. Pass LocaleList.Empty to express the intention that a specific hint should not be set.

Public functions

copy

fun copy(
    singleLine: Boolean = this.singleLine,
    capitalization: KeyboardCapitalization = this.capitalization,
    autoCorrect: Boolean = this.autoCorrect,
    keyboardType: KeyboardType = this.keyboardType,
    imeAction: ImeAction = this.imeAction,
    platformImeOptions: PlatformImeOptions? = this.platformImeOptions,
    hintLocales: LocaleList = this.hintLocales
): ImeOptions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

autoCorrect

val autoCorrectBoolean

informs the IME whether to enable auto correct. Only applicable to text based KeyboardTypes such as KeyboardType.Email, KeyboardType.Uri. It will not be applied to KeyboardTypes such as KeyboardType.Number or KeyboardType.Decimal. Most of IME implementations ignore this value for KeyboardTypes such as KeyboardType.Text.

capitalization

val capitalizationKeyboardCapitalization

informs the IME whether to automatically capitalize characters, words or sentences. Only applicable to only text based KeyboardTypes such as KeyboardType.Text, KeyboardType.Ascii. It will not be applied to KeyboardTypes such as KeyboardType.Number or KeyboardType.Decimal.

hintLocales

val hintLocalesLocaleList

List of the languages that the user is supposed to switch to no matter what input method subtype is currently used. This special "hint" can be used mainly for, but not limited to, multilingual users who want IMEs to switch language based on editor's context. Pass LocaleList.Empty to express the intention that a specific hint should not be set.

imeAction

val imeActionImeAction

The IME action. This IME action is honored by IME and may show specific icons on the keyboard. For example, search icon may be shown if ImeAction.Search is specified. When singleLine is false, the IME might show return key rather than the action requested here.

keyboardType

val keyboardTypeKeyboardType

The keyboard type to be used in this text field. Note that this input type is honored by IME and shows corresponding keyboard but this is not guaranteed. For example, some IME may send non-ASCII character even if you set KeyboardType.Ascii.

platformImeOptions

val platformImeOptionsPlatformImeOptions?

defines the platform specific IME options.

singleLine

val singleLineBoolean

informs the IME that the text field is single line and IME should not show return key.