Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Correctly check for IME Action when processing the done key. Fixes #1816
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Sep 13, 2019
1 parent e2eec13 commit 8881dfd
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ protected void onDismiss() {

@Override
public void onPress(int primaryCode) {
Log.d("VRB", "Keyboard onPress " + primaryCode);
Log.d(LOGTAG, "Keyboard onPress " + primaryCode);
}

@Override
Expand Down Expand Up @@ -447,7 +447,7 @@ public void onRelease(int primaryCode) {

@Override
public void onKey(int primaryCode, int[] keyCodes, boolean hasPopup) {
Log.d("VRB", "Keyboard onPress++ " + primaryCode);
Log.d(LOGTAG, "Keyboard onPress++ " + primaryCode);
switch (primaryCode) {
case Keyboard.KEYCODE_MODE_CHANGE:
handleModeChange();
Expand Down Expand Up @@ -716,8 +716,9 @@ private void handleDone() {
final int action = mEditorInfo.imeOptions & EditorInfo.IME_MASK_ACTION;
postInputCommand(() -> connection.performEditorAction(action));

boolean hide = (action & (EditorInfo.IME_ACTION_DONE | EditorInfo.IME_ACTION_GO |
EditorInfo.IME_ACTION_SEARCH | EditorInfo.IME_ACTION_SEND)) != 0;
boolean hide = (action == EditorInfo.IME_ACTION_DONE) || (action == EditorInfo.IME_ACTION_GO) ||
(action == EditorInfo.IME_ACTION_SEARCH) || (action == EditorInfo.IME_ACTION_SEND);

if (hide && mFocusedView != null) {
mFocusedView.clearFocus();
}
Expand Down

0 comments on commit 8881dfd

Please sign in to comment.