Skip to content

Commit

Permalink
fix dialog on touch event logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rymorale committed Nov 14, 2023
1 parent e1043d6 commit 4e9c1e5
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,30 +210,28 @@ public boolean onTouchEvent(@NonNull final MotionEvent motionEvent) {
if (!uiTakeoverEnabled) {
// only log action up or down events as this logging can get quite
// spammy
if (motionEvent.getAction() == MotionEvent.ACTION_DOWN
|| motionEvent.getAction() == MotionEvent.ACTION_UP) {
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
Log.trace(
ServiceConstants.LOG_TAG,
TAG,
"UI takeover is false, passing the %s event to the parent"
+ " activity.",
MotionEvent.actionToString(motionEvent.getAction()));
"UI takeover is false, passing the touch event to the parent"
+ " activity.");
}
return parentActivity.dispatchTouchEvent(motionEvent);
} else {
// load any behavior url strings on action up only as a touch consists of
// two motion events: an action down and an action up event
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
Log.trace(
ServiceConstants.LOG_TAG,
TAG,
"UI takeover is true, parent activity UI is inaccessible."
+ " Processing defined background tap behaviors.");
webViewGestureListener.handleGesture(MessageGesture.BACKGROUND_TAP);
return true;
}
parentActivity.dispatchTouchEvent(motionEvent);
return false;
}

// load any behavior url strings on action up only as a touch consists of
// two motion events: an action down and an action up event
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
Log.trace(
ServiceConstants.LOG_TAG,
TAG,
"UI takeover is true, parent activity UI is inaccessible. Processing"
+ " defined background tap behaviors.");
webViewGestureListener.handleGesture(MessageGesture.BACKGROUND_TAP);
}
return false;
return super.onTouchEvent(motionEvent);
}
};
}
Expand Down

0 comments on commit 4e9c1e5

Please sign in to comment.