Package io.flutter.plugin.editing
Class TextInputPlugin
java.lang.Object
io.flutter.plugin.editing.TextInputPlugin
Android implementation of the text input plugin.
-
Constructor Summary
ConstructorDescriptionTextInputPlugin
(View view, TextInputChannel textInputChannel, PlatformViewsController platformViewsController) -
Method Summary
Modifier and TypeMethodDescriptionvoid
autofill
(SparseArray<AutofillValue> values) void
clearPlatformViewClient
(int platformViewId) Clears a platform view text input client if it is the current input target.createInputConnection
(View view, KeyboardManager keyboardManager, EditorInfo outAttrs) void
destroy()
Detaches the text input plugin from the platform views controller.void
didChangeEditingState
(boolean textChanged, boolean selectionChanged, boolean composingRegionChanged) boolean
handleKeyEvent
(KeyEvent keyEvent) void
Use the current platform view input connection until unlockPlatformViewInputConnection is called.void
onProvideAutofillVirtualStructure
(ViewStructure structure, int flags) void
sendTextInputAppPrivateCommand
(String action, Bundle data) void
Unlocks the input connection.
-
Constructor Details
-
TextInputPlugin
public TextInputPlugin(@NonNull View view, @NonNull TextInputChannel textInputChannel, @NonNull PlatformViewsController platformViewsController)
-
-
Method Details
-
getInputMethodManager
-
lockPlatformViewInputConnection
public void lockPlatformViewInputConnection()Use the current platform view input connection until unlockPlatformViewInputConnection is called.The current input connection instance is cached and any following call to @{link createInputConnection} returns the cached connection until unlockPlatformViewInputConnection is called.
This is a no-op if the current input target isn't a platform view.
This is used to preserve an input connection when moving a platform view from one virtual display to another.
-
unlockPlatformViewInputConnection
public void unlockPlatformViewInputConnection()Unlocks the input connection.See also: @{link lockPlatformViewInputConnection}.
-
destroy
public void destroy()Detaches the text input plugin from the platform views controller.The TextInputPlugin instance should not be used after calling this.
-
createInputConnection
@Nullable public InputConnection createInputConnection(@NonNull View view, @NonNull KeyboardManager keyboardManager, @NonNull EditorInfo outAttrs) -
getLastInputConnection
-
clearPlatformViewClient
public void clearPlatformViewClient(int platformViewId) Clears a platform view text input client if it is the current input target.This is called when a platform view is disposed to make sure we're not hanging to a stale input connection.
-
sendTextInputAppPrivateCommand
-
handleKeyEvent
-
didChangeEditingState
public void didChangeEditingState(boolean textChanged, boolean selectionChanged, boolean composingRegionChanged) -
onProvideAutofillVirtualStructure
-
autofill
-