Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timob-14940: Android: touchend event not fired if two touches occured #4917

Merged
merged 2 commits into from
Nov 7, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1378,13 +1378,23 @@ public boolean onTouch(View view, MotionEvent event)
didScale = false;
pointersDown = 0;
} else {
pointersDown++;
int index = event.getActionIndex();
float x = event.getX(index);
float y = event.getY(index);
if (x >= 0 && x < touchable.getWidth() && y >= 0 && y < touchable.getHeight()) {
// If the second touch-up happens inside the view, it is a two-finger touch.
pointersDown++;
}
}
} else if (event.getAction() == MotionEvent.ACTION_UP) {
if (pointersDown == 1) {
fireEvent(TiC.EVENT_TWOFINGERTAP, dictFromEvent(event));
pointersDown = 0;
return true;
// Don't fire twofingertap if there is no listener
if (proxy.hierarchyHasListener(TiC.EVENT_TWOFINGERTAP) && pointersDown == 1) {
float x = event.getX();
float y = event.getY();
if (x >= 0 && x < touchable.getWidth() && y >= 0 && y < touchable.getHeight()) {
// If the touch-up happens inside the view, fire the event.
fireEvent(TiC.EVENT_TWOFINGERTAP, dictFromEvent(event));
}
}
pointersDown = 0;
}
Expand Down