InputMethodImpl
open class InputMethodImpl : AbstractInputMethodService.AbstractInputMethodImpl
kotlin.Any | ||
↳ | android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl | |
↳ | android.inputmethodservice.InputMethodService.InputMethodImpl |
Concrete implementation of AbstractInputMethodService.AbstractInputMethodImpl
that provides all of the standard behavior for an input method.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
Public methods | |
---|---|
open Unit |
attachToken(token: IBinder!) Called first thing after an input method is created, this supplies a unique token for the session it has with the system service. |
open Unit |
bindInput(binding: InputBinding!) Bind a new application environment in to the input method, so that it can later start and stop input processing. |
open Unit |
changeInputMethodSubtype(subtype: InputMethodSubtype!) Notify that the input method subtype is being changed in the same input method. |
open Unit |
hideSoftInput(flags: Int, resultReceiver: ResultReceiver!) Request that any soft input part of the input method be hidden from the user. |
open Unit |
restartInput(ic: InputConnection!, editorInfo: EditorInfo!) This method is called when the state of this input method needs to be reset. |
open Unit |
showSoftInput(flags: Int, resultReceiver: ResultReceiver!) Request that any soft input part of the input method be shown to the user. |
open Unit |
startInput(ic: InputConnection!, editorInfo: EditorInfo!) This method is called when the application starts to receive text and it is ready for this input method to process received events and send result text back to the application. |
open Unit |
Unbind an application environment, called when the information previously set by |
Inherited functions | |
---|---|
Public constructors
InputMethodImpl
InputMethodImpl()
Public methods
attachToken
open fun attachToken(token: IBinder!): Unit
Called first thing after an input method is created, this supplies a unique token for the session it has with the system service. It is needed to identify itself with the service to validate its operations. This token must not be passed to applications, since it grants special priviledges that should not be given to applications.
The system guarantees that this method is called back between InputMethodService.onCreate()
and android.inputmethodservice.InputMethodService#onDestroy() at most once.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
bindInput
open fun bindInput(binding: InputBinding!): Unit
Bind a new application environment in to the input method, so that it can later start and stop input processing. Typically this method is called when this input method is enabled in an application for the first time. This method must be called from the main thread of your app.
Calls InputMethodService.onBindInput()
when done.
This method must be called from the main thread of your app.
Parameters | |
---|---|
binding |
InputBinding!: Information about the application window that is binding to the input method. |
changeInputMethodSubtype
open fun changeInputMethodSubtype(subtype: InputMethodSubtype!): Unit
Notify that the input method subtype is being changed in the same input method.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
Parameters | |
---|---|
subtype |
InputMethodSubtype!: New subtype of the notified input method |
hideSoftInput
open fun hideSoftInput(
flags: Int,
resultReceiver: ResultReceiver!
): Unit
Request that any soft input part of the input method be hidden from the user.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
Parameters | |
---|---|
flags |
Int: Provides additional information about the hide request. Currently always 0. |
resultReceiver |
ResultReceiver!: The client requesting the show may wish to be told the impact of their request, which should be supplied here. The result code should be InputMethodManager.RESULT_UNCHANGED_SHOWN , InputMethodManager.RESULT_UNCHANGED_HIDDEN , InputMethodManager.RESULT_SHOWN , or InputMethodManager.RESULT_HIDDEN . |
restartInput
open fun restartInput(
ic: InputConnection!,
editorInfo: EditorInfo!
): Unit
This method is called when the state of this input method needs to be reset.
Typically, this method is called when the input focus is moved from one text box to another.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
Parameters | |
---|---|
inputConnection |
Optional specific input connection for communicating with the text box; if null, you should use the generic bound input connection. |
editorInfo |
EditorInfo!: The attribute of the text box (typically, a EditText) that requests input. |
showSoftInput
open fun showSoftInput(
flags: Int,
resultReceiver: ResultReceiver!
): Unit
Request that any soft input part of the input method be shown to the user.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
Parameters | |
---|---|
resultReceiver |
ResultReceiver!: The client requesting the show may wish to be told the impact of their request, which should be supplied here. The result code should be InputMethodManager.RESULT_UNCHANGED_SHOWN , InputMethodManager.RESULT_UNCHANGED_HIDDEN , InputMethodManager.RESULT_SHOWN , or InputMethodManager.RESULT_HIDDEN . |
flags |
Int: Value is either 0 or a combination of android.view.inputmethod.InputMethod#SHOW_EXPLICIT , and android.view.inputmethod.InputMethod#SHOW_FORCED |
startInput
open fun startInput(
ic: InputConnection!,
editorInfo: EditorInfo!
): Unit
This method is called when the application starts to receive text and it is ready for this input method to process received events and send result text back to the application.
This method must be called from the main thread of your app.
This method must be called from the main thread of your app.
Parameters | |
---|---|
inputConnection |
Optional specific input connection for communicating with the text box; if null, you should use the generic bound input connection. |
editorInfo |
EditorInfo!: Information about the text box (typically, an EditText) that requests input. |
unbindInput
open fun unbindInput(): Unit
Unbind an application environment, called when the information previously set by bindInput
is no longer valid for this input method.
Typically this method is called when the application changes to be non-foreground.
This method must be called from the main thread of your app.
Calls InputMethodService.onUnbindInput()
when done.
This method must be called from the main thread of your app.