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

Correctly check for IME Action when processing the done key. Fixes #1816 #1827

Merged
merged 1 commit into from
Sep 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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