Skip to content

Commit

Permalink
[TIMOB-25882] Android: return event is received twice from Symbol TC5…
Browse files Browse the repository at this point in the history
…5/TC70 scanner. (tidev#9948)

* Prevent double onActionEditor call from simulated enter key.

* Change check for TextField.

* Forgot the 'this'.
  • Loading branch information
ypbnv authored and sgtcoolguy committed Apr 23, 2018
1 parent 53a0f48 commit ce00485
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,12 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent keyEvent)
// And because of that we skip the firing of a RETURN event from this call in favor of the
// one from onTextChanged. The event carries a property to determine whether it was fired
// from the IME_ACTION button or the new line one.
if (field) {
if (this.field) {
fireEvent(TiC.EVENT_RETURN, data);
// Since IME_ACTION_NEXT and IME_ACTION_DONE take care of consuming the second call to
// onEditorAction we do not consume it for either of them.
return (!(actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE));
return (!(actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE
|| (keyEvent != null)));
} else {
// After clicking the IME_ACTION button we get two calls of onEditorAction.
// The second call of onEditorAction is treated as a KeyPress event and gives the
Expand Down

0 comments on commit ce00485

Please sign in to comment.