KeyboardOptions
-
Cmn
class KeyboardOptions
The keyboard configuration options for TextFields. It is not guaranteed if software keyboard will comply with the options provided here.
Summary
Public companion properties |
||
---|---|---|
KeyboardOptions |
Default |
Cmn
|
Public constructors |
|
---|---|
This function is deprecated. Please use the new constructor that takes optional autoCorrectEnabled parameter. |
Cmn
|
KeyboardOptions( |
Cmn
|
Public functions |
||
---|---|---|
KeyboardOptions |
copy( Returns a copy of this object with the values passed to this method. |
Cmn
|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
KeyboardOptions |
merge(other: KeyboardOptions?) Returns a new |
Cmn
|
open String |
toString() |
Cmn
|
Public properties |
||
---|---|---|
Boolean |
This property is deprecated. Please use the autoCorrectEnabled property. |
Cmn
|
Boolean? |
informs the keyboard whether to enable auto correct. |
Cmn
|
KeyboardCapitalization |
informs the keyboard 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? |
when true, software keyboard will show on focus gain. |
Cmn
|
Public companion properties
Default
val Default: KeyboardOptions
Default KeyboardOptions
. Please see parameter descriptions for default values.
Public constructors
KeyboardOptions
KeyboardOptions(
capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified,
autoCorrect: Boolean,
keyboardType: KeyboardType = KeyboardType.Unspecified,
imeAction: ImeAction = ImeAction.Unspecified,
platformImeOptions: PlatformImeOptions? = null,
showKeyboardOnFocus: Boolean? = null,
hintLocales: LocaleList? = null
)
KeyboardOptions
KeyboardOptions(
capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified,
autoCorrectEnabled: Boolean? = null,
keyboardType: KeyboardType = KeyboardType.Unspecified,
imeAction: ImeAction = ImeAction.Unspecified,
platformImeOptions: PlatformImeOptions? = null,
showKeyboardOnFocus: Boolean? = null,
hintLocales: LocaleList? = null
)
Parameters | |
---|---|
capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified |
informs the keyboard whether to automatically capitalize characters, words or sentences. Only applicable to only text based |
autoCorrectEnabled: Boolean? = null |
informs the keyboard whether to enable auto correct. Only applicable to text based |
keyboardType: KeyboardType = KeyboardType.Unspecified |
The keyboard type to be used in this text field. Note that this input type is honored by keyboard and shows corresponding keyboard but this is not guaranteed. For example, some keyboards may send non-ASCII character even if you set |
imeAction: ImeAction = ImeAction.Unspecified |
The IME action. This IME action is honored by keyboard and may show specific icons on the keyboard. For example, search icon may be shown if |
platformImeOptions: PlatformImeOptions? = null |
defines the platform specific IME options. |
showKeyboardOnFocus: Boolean? = null |
when true, software keyboard will show on focus gain. When false, the user must interact (e.g. tap) before the keyboard is shown. A null value (the default parameter value) means the keyboard will be shown on focus. |
hintLocales: LocaleList? = null |
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 null to express the intention that a specific hint should not be set. |
Public functions
copy
fun copy(
capitalization: KeyboardCapitalization = this.capitalization,
autoCorrectEnabled: Boolean? = this.autoCorrectEnabled,
keyboardType: KeyboardType = this.keyboardType,
imeAction: ImeAction = this.imeAction,
platformImeOptions: PlatformImeOptions? = this.platformImeOptions,
showKeyboardOnFocus: Boolean? = null,
hintLocales: LocaleList? = null
): KeyboardOptions
Returns a copy of this object with the values passed to this method.
Note that if an unspecified (null) value is passed explicitly to this method, it will replace any actually-specified value. This differs from the behavior of merge
, which will never take an unspecified value over a specified one.
merge
fun merge(other: KeyboardOptions?): KeyboardOptions
Returns a new KeyboardOptions
that is a combination of this options and a given other
options.
other
s null or Unspecified
properties are replaced with the non-null properties of this object.
If the either this or other
is null, returns the non-null one.
Public properties
autoCorrectEnabled
val autoCorrectEnabled: Boolean?
informs the keyboard whether to enable auto correct. Only applicable to text based KeyboardType
s such as KeyboardType.Email
, KeyboardType.Uri
. It will not be applied to KeyboardType
s such as KeyboardType.Number
. Most of keyboard implementations ignore this value for KeyboardType
s such as KeyboardType.Text
. A null value (the default parameter value) means autocorrect will be enabled.
capitalization
val capitalization: KeyboardCapitalization
informs the keyboard whether to automatically capitalize characters, words or sentences. Only applicable to only text based KeyboardType
s such as KeyboardType.Text
, KeyboardType.Ascii
. It will not be applied to KeyboardType
s such as KeyboardType.Number
.
hintLocales
val hintLocales: LocaleList?
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 null to express the intention that a specific hint should not be set.
imeAction
val imeAction: ImeAction
The IME action. This IME action is honored by keyboard and may show specific icons on the keyboard. For example, search icon may be shown if ImeAction.Search
is specified. When ImeOptions.singleLine
is false, the keyboard 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 keyboard and shows corresponding keyboard but this is not guaranteed. For example, some keyboards may send non-ASCII character even if you set KeyboardType.Ascii
.
platformImeOptions
val platformImeOptions: PlatformImeOptions?
defines the platform specific IME options.
showKeyboardOnFocus
val showKeyboardOnFocus: Boolean?
when true, software keyboard will show on focus gain. When false, the user must interact (e.g. tap) before the keyboard is shown. A null value (the default parameter value) means the keyboard will be shown on focus.