public static interface GeckoSession.TextInputDelegate
InputMethodManager
automatically.Modifier and Type | Field and Description |
---|---|
static int |
RESTART_REASON_BLUR
Restarting input due to an input field losing focus.
|
static int |
RESTART_REASON_CONTENT_CHANGE
Restarting input due to the content of the input field changing.
|
static int |
RESTART_REASON_FOCUS
Restarting input due to an input field gaining focus.
|
Modifier and Type | Method and Description |
---|---|
default void |
hideSoftInput(GeckoSession session)
Hide the soft input.
|
default void |
restartInput(GeckoSession session,
int reason)
Reset the input method, and discard any existing states such as the current composition
or current autocompletion.
|
default void |
showSoftInput(GeckoSession session)
Display the soft input.
|
default void |
updateCursorAnchorInfo(GeckoSession session,
CursorAnchorInfo info)
Update the cursor-anchor information as requested through
InputConnection.requestCursorUpdates(int) . |
default void |
updateExtractedText(GeckoSession session,
ExtractedTextRequest request,
ExtractedText text)
Update the soft input on the current extracted text, as requested through
InputConnection.getExtractedText(android.view.inputmethod.ExtractedTextRequest, int) . |
default void |
updateSelection(GeckoSession session,
int selStart,
int selEnd,
int compositionStart,
int compositionEnd)
Update the soft input on the current selection.
|
static final int RESTART_REASON_FOCUS
static final int RESTART_REASON_BLUR
static final int RESTART_REASON_CONTENT_CHANGE
@UiThread default void restartInput(@NonNull GeckoSession session, int reason)
SessionTextInput.onCreateInputConnection(android.view.inputmethod.EditorInfo)
to update its knowledge of the focused editor.
Note that restartInput
should be used to detect changes in focus, rather than
showSoftInput(org.mozilla.geckoview.GeckoSession)
or hideSoftInput(org.mozilla.geckoview.GeckoSession)
, because focus changes are not always
accompanied by requests to show or hide the soft input. This method is always called,
even in viewless mode.session
- Session instance.reason
- Reason for the reset.@UiThread default void showSoftInput(@NonNull GeckoSession session)
session
- Session instance.hideSoftInput(org.mozilla.geckoview.GeckoSession)
@UiThread default void hideSoftInput(@NonNull GeckoSession session)
session
- Session instance.showSoftInput(org.mozilla.geckoview.GeckoSession)
@UiThread default void updateSelection(@NonNull GeckoSession session, int selStart, int selEnd, int compositionStart, int compositionEnd)
session
- Session instance.selStart
- Start offset of the selection.selEnd
- End offset of the selection.compositionStart
- Composition start offset, or -1 if there is no composition.compositionEnd
- Composition end offset, or -1 if there is no composition.@UiThread default void updateExtractedText(@NonNull GeckoSession session, @NonNull ExtractedTextRequest request, @NonNull ExtractedText text)
InputConnection.getExtractedText(android.view.inputmethod.ExtractedTextRequest, int)
.
Consequently, this method is not called in viewless mode.session
- Session instance.request
- The extract text request.text
- The extracted text.@UiThread default void updateCursorAnchorInfo(@NonNull GeckoSession session, @NonNull CursorAnchorInfo info)
InputConnection.requestCursorUpdates(int)
.
Consequently, this method is not called in viewless mode.session
- Session instance.info
- Cursor-anchor information.