1
0
Fork 0

partially revert 8ce404d2b6 to have the correct OK event when when the connected app requests a standard IME action (#325)

This commit is contained in:
Dimo Karaivanov 2023-08-01 09:55:56 +03:00 committed by GitHub
parent c0eb1eafbb
commit cd60c55fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -326,18 +326,22 @@ public class TextField {
return EditorInfo.IME_ACTION_NONE; return EditorInfo.IME_ACTION_NONE;
} }
int action; if (field.actionId == EditorInfo.IME_ACTION_DONE) {
if (field.actionId > 0) { return IME_ACTION_ENTER;
action = field.actionId; // custom action, defined by the connected app } else if (field.actionId > 0) {
} else { return field.actionId;
action = field.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
} }
switch (action) {
case EditorInfo.IME_ACTION_UNSPECIFIED: int standardAction = field.imeOptions & (EditorInfo.IME_MASK_ACTION | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
case EditorInfo.IME_ACTION_DONE: switch (standardAction) {
return IME_ACTION_ENTER; case EditorInfo.IME_ACTION_GO:
case EditorInfo.IME_ACTION_NEXT:
case EditorInfo.IME_ACTION_PREVIOUS:
case EditorInfo.IME_ACTION_SEARCH:
case EditorInfo.IME_ACTION_SEND:
return standardAction;
default: default:
return action; return IME_ACTION_ENTER;
} }
} }
} }