{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ImeOptions

public final class ImeOptions


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

Summary

Nested types

public static class ImeOptions.Companion

Public constructors

ImeOptions(
    boolean singleLine,
    @NonNull KeyboardCapitalization capitalization,
    boolean autoCorrect,
    @NonNull KeyboardType keyboardType,
    @NonNull ImeAction imeAction
)

Public methods

final @NonNull ImeOptions
copy(
    boolean singleLine,
    @NonNull KeyboardCapitalization capitalization,
    boolean autoCorrect,
    @NonNull KeyboardType keyboardType,
    @NonNull ImeAction imeAction
)
boolean
equals(Object other)
final boolean

informs the IME whether to enable auto correct.

final @NonNull KeyboardCapitalization

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

final @NonNull ImeAction

The IME action.

final @NonNull KeyboardType

The keyboard type to be used in this text field.

final boolean

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

int
@NonNull String

Public constructors

ImeOptions

public ImeOptions(
    boolean singleLine,
    @NonNull KeyboardCapitalization capitalization,
    boolean autoCorrect,
    @NonNull KeyboardType keyboardType,
    @NonNull ImeAction imeAction
)
Parameters
boolean singleLine

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

@NonNull KeyboardCapitalization capitalization

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.

boolean autoCorrect

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.

@NonNull 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.

@NonNull 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.

Public methods

copy

public final @NonNull ImeOptions copy(
    boolean singleLine,
    @NonNull KeyboardCapitalization capitalization,
    boolean autoCorrect,
    @NonNull KeyboardType keyboardType,
    @NonNull ImeAction imeAction
)

equals

public boolean equals(Object other)

getAutoCorrect

public final boolean getAutoCorrect()

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.

getCapitalization

public final @NonNull KeyboardCapitalization getCapitalization()

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.

getImeAction

public final @NonNull ImeAction getImeAction()

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.

getKeyboardType

public final @NonNull KeyboardType getKeyboardType()

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.

getSingleLine

public final boolean getSingleLine()

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

hashCode

public int hashCode()

toString

public @NonNull String toString()