Interface TextInputChannel.TextInputMethodHandler
- Enclosing class:
TextInputChannel
public static interface TextInputChannel.TextInputMethodHandler
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the active text input client and tears down the text editing connection.voidfinishAutofillContext(boolean shouldSave) Requests that theAutofillManagercancel or commit the current autofill context.voidhide()Requests that the software keyboard (IME) be hidden from screen, dismissing the current text input view.voidRequests that the autofill dropdown menu appear for the current client.voidsendAppPrivateCommand(String action, Bundle data) Sends client app private command to the current text input client(input method).voidsetClient(int textInputClientId, TextInputChannel.Configuration configuration) Sets the active text input client identifier along with its input text configurations (e.g., text capitalization rules, obscure text flags, and input actions such as done, go, or next).voidsetEditableSizeAndTransform(double width, double height, double[] transform) Sets the size and the transform matrix of the current text input client.voidsetEditingState(TextInputChannel.TextEditState editingState) Sets the current text selection, composing ranges, and raw string contents for the active text input client.voidsetPlatformViewClient(int id, boolean usesVirtualDisplay) Sets a platform view as the text input client.voidshow()Requests that the software keyboard (IME) be displayed on screen for the active text input client.
-
Method Details
-
show
void show()Requests that the software keyboard (IME) be displayed on screen for the active text input client. -
hide
void hide()Requests that the software keyboard (IME) be hidden from screen, dismissing the current text input view. -
requestAutofill
void requestAutofill()Requests that the autofill dropdown menu appear for the current client.Has no effect if the current client does not support autofill.
-
finishAutofillContext
void finishAutofillContext(boolean shouldSave) Requests that theAutofillManagercancel or commit the current autofill context.The method calls
AutofillManager.commit()whenshouldSaveis true, and callsAutofillManager.cancel()otherwise.- Parameters:
shouldSave- whether the active autofill service should save the current user input for future use.
-
setClient
Sets the active text input client identifier along with its input text configurations (e.g., text capitalization rules, obscure text flags, and input actions such as done, go, or next).- Parameters:
textInputClientId- The unique ID of the text input client sent by the Dart framework viaTextInput.setClient.configuration- TheTextInputChannel.Configurationtext editing configuration containing layout and behavior options.
-
setPlatformViewClient
void setPlatformViewClient(int id, boolean usesVirtualDisplay) Sets a platform view as the text input client.Subsequent calls to createInputConnection will be delegated to the platform view until a different client is set.
- Parameters:
id- the ID of the platform view to be set as a text input client.usesVirtualDisplay- True if the platform view uses a virtual display, false if it uses hybrid composition.
-
setEditableSizeAndTransform
void setEditableSizeAndTransform(double width, double height, @NonNull double[] transform) Sets the size and the transform matrix of the current text input client.- Parameters:
width- the width of text input client. Must be finite.height- the height of text input client. Must be finite.transform- a 4x4 matrix that maps the local paint coordinate system to coordinate system of the FlutterView that owns the current client.
-
setEditingState
Sets the current text selection, composing ranges, and raw string contents for the active text input client.- Parameters:
editingState- The text state model containing the text, selections, and composing offsets.
-
clearClient
void clearClient()Clears the active text input client and tears down the text editing connection. -
sendAppPrivateCommand
Sends client app private command to the current text input client(input method). The app private command result will be informed throughperformPrivateCommand.- Parameters:
action- Name of the command to be performed. This must be a scoped name. i.e. prefixed with a package name you own, so that different developers will not create conflicting commands.data- Any data to include with the command.
-