From 0af282e35efe81483d9b054e11245d3ef6989b2b Mon Sep 17 00:00:00 2001 From: "Randall E. Barker" Date: Thu, 12 Sep 2019 17:25:18 -0700 Subject: [PATCH] Correctly check for IME Action when processing the done key. Fixes #1816 --- .../org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java index c104c023e..ecf7319bb 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/KeyboardWidget.java @@ -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 @@ -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(); @@ -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(); }