You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
handle onClickListener for synthesized MotionEvents
Since synthesized events can't be handled by GTK, we also need to handle gestures by ourself in that case.
This commit is contained in:
@@ -1076,7 +1076,7 @@ public class View implements Drawable.Callback {
|
||||
|
||||
private OnTouchListener on_touch_listener = null;
|
||||
|
||||
public boolean onTouchEventInternal(MotionEvent event) {
|
||||
public boolean onTouchEventInternal(MotionEvent event, boolean handle_gestures) {
|
||||
boolean handled = false;
|
||||
if (on_touch_listener != null)
|
||||
handled = on_touch_listener.onTouch(this, event);
|
||||
@@ -1084,6 +1084,9 @@ public class View implements Drawable.Callback {
|
||||
if (!handled)
|
||||
handled = onTouchEvent(event);
|
||||
|
||||
if (handle_gestures && !handled && event.getAction() == MotionEvent.ACTION_UP)
|
||||
handled = performClick();
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user