public class InputMethodService.InputMethodSessionImpl extends AbstractInputMethodService.AbstractInputMethodSessionImpl
AbstractInputMethodService.AbstractInputMethodSessionImpl
that provides
all of the standard behavior for an input method session.InputMethodSession.EventCallback
Constructor and Description |
---|
InputMethodSessionImpl() |
Modifier and Type | Method and Description |
---|---|
void |
appPrivateCommand(String action,
Bundle data)
|
void |
displayCompletions(CompletionInfo[] completions)
|
void |
finishInput()
This method is called when the application would like to stop
receiving text input.
|
void |
toggleSoftInput(int showFlags,
int hideFlags)
Toggle the soft input window.
|
void |
updateCursor(Rect newCursor)
|
void |
updateCursorAnchorInfo(CursorAnchorInfo info)
|
void |
updateExtractedText(int token,
ExtractedText text)
|
void |
updateSelection(int oldSelStart,
int oldSelEnd,
int newSelStart,
int newSelEnd,
int candidatesStart,
int candidatesEnd)
|
void |
viewClicked(boolean focusChanged)
This method is called when the user tapped a text view.
|
dispatchGenericMotionEvent, dispatchKeyEvent, dispatchTrackballEvent, isEnabled, isRevoked, revokeSelf, setEnabled
public void finishInput()
InputMethodSession
public void displayCompletions(CompletionInfo[] completions)
completions
- Array of text completions that are available, starting with
the best. If this array is null, any existing completions will be
removed.public void updateExtractedText(int token, ExtractedText text)
token
- The input method supplied token for identifying its request.text
- The new extracted text.public void updateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd)
oldSelStart
- The previous text offset of the cursor selection
start position.oldSelEnd
- The previous text offset of the cursor selection
end position.newSelStart
- The new text offset of the cursor selection
start position.newSelEnd
- The new text offset of the cursor selection
end position.candidatesStart
- The text offset of the current candidate
text start position.candidatesEnd
- The text offset of the current candidate
text end position.public void viewClicked(boolean focusChanged)
InputMethodSession
focusChanged
- true if the user changed the focused view by this click.public void updateCursor(Rect newCursor)
newCursor
- The rectangle of the cursor currently being shown in
the input field's window coordinates.public void appPrivateCommand(String action, Bundle data)
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.public void toggleSoftInput(int showFlags, int hideFlags)
InputMethodSession
showFlags
- Provides additional operating flags. May be
0 or have the InputMethodManager.SHOW_IMPLICIT
,
InputMethodManager.SHOW_FORCED
bit set.hideFlags
- Provides additional operating flags. May be
0 or have the InputMethodManager.HIDE_IMPLICIT_ONLY
,
InputMethodManager.HIDE_NOT_ALWAYS
bit set.public void updateCursorAnchorInfo(CursorAnchorInfo info)
info
- Positional information relevant to text input, such as text
insertion point and composition string.