Google is committed to advancing racial equity for Black communities. See how.

ImeOptions

@Immutable data class ImeOptions
kotlin.Any
   ↳ androidx.compose.ui.text.input.ImeOptions

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

Summary

Public constructors
<init>(singleLine: Boolean = false, capitalization: KeyboardCapitalization = KeyboardCapitalization.None, autoCorrect: Boolean = true, keyboardType: KeyboardType = KeyboardType.Text, imeAction: ImeAction = ImeAction.Unspecified)

The IME configuration options for TextInputService.

Properties
Boolean

informs the IME whether to enable auto correct.

KeyboardCapitalization

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

ImeAction

The IME action.

KeyboardType

The keyboard type to be used in this text field.

Boolean

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

Companion properties
ImeOptions

Default ImeOptions.

Public constructors

<init>

ImeOptions(
    singleLine: Boolean = false,
    capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
    autoCorrect: Boolean = true,
    keyboardType: KeyboardType = KeyboardType.Text,
    imeAction: ImeAction = ImeAction.Unspecified)

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

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.
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. 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.Unspecified 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.

Properties

autoCorrect

val autoCorrect: Boolean

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. Most of IME implementations ignore this value for KeyboardTypes such as KeyboardType.Text.

capitalization

val capitalization: KeyboardCapitalization

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.

imeAction

val imeAction: ImeAction

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 keyboardType: KeyboardType

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.

singleLine

val singleLine: Boolean

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

Companion properties

Default

val Default: ImeOptions

Default ImeOptions. Please see parameter descriptions for default values.