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:
parent
c0eb1eafbb
commit
cd60c55fe5
1 changed files with 14 additions and 10 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue