Allowing ListenerView intercept events in system areas
See the discussion in thje bug
Bug: 156044202
Change-Id: I68b3826602250ef163b96be95d80b98691456443
diff --git a/src/com/android/launcher3/AbstractFloatingView.java b/src/com/android/launcher3/AbstractFloatingView.java
index 1aa3144..572615f 100644
--- a/src/com/android/launcher3/AbstractFloatingView.java
+++ b/src/com/android/launcher3/AbstractFloatingView.java
@@ -257,4 +257,8 @@
@FloatingViewType int type) {
return getOpenView(activity, type);
}
+
+ public boolean canInterceptEventsInSystemGestureRegion() {
+ return false;
+ }
}
diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java
index c37c47c..f54edc2 100644
--- a/src/com/android/launcher3/views/BaseDragLayer.java
+++ b/src/com/android/launcher3/views/BaseDragLayer.java
@@ -186,11 +186,12 @@
+ ", isEventInLauncher=" + isEventInLauncher(ev)
+ ", topOpenView=" + AbstractFloatingView.getTopOpenView(mActivity));
}
- if (isEventInLauncher(ev)) {
- AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
- if (topView != null && topView.onControllerInterceptTouchEvent(ev)) {
- return topView;
- }
+
+ AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
+ if (topView != null
+ && (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion())
+ && topView.onControllerInterceptTouchEvent(ev)) {
+ return topView;
}
for (TouchController controller : mControllers) {
diff --git a/src/com/android/launcher3/views/ListenerView.java b/src/com/android/launcher3/views/ListenerView.java
index 575f864..3ef778b 100644
--- a/src/com/android/launcher3/views/ListenerView.java
+++ b/src/com/android/launcher3/views/ListenerView.java
@@ -106,4 +106,9 @@
// We want other views to be able to intercept the touch so we return false here.
return false;
}
+
+ @Override
+ public boolean canInterceptEventsInSystemGestureRegion() {
+ return true;
+ }
}