diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java index 491938d2b5..f6478df7ba 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java @@ -146,6 +146,15 @@ public class TaskbarDragLayer extends BaseDragLayer { onDestroy(true); } + @Override + protected boolean isEventWithinSystemGestureRegion(MotionEvent ev) { + final float x = ev.getX(); + final float y = ev.getY(); + + return x >= mSystemGestureRegion.left && x < getWidth() - mSystemGestureRegion.right + && y >= mSystemGestureRegion.top; + } + @Override protected boolean canFindActiveController() { // Unlike super class, we want to be able to find controllers when touches occur in the diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java index abc5ef88dd..5d2d3f4e9f 100644 --- a/src/com/android/launcher3/views/BaseDragLayer.java +++ b/src/com/android/launcher3/views/BaseDragLayer.java @@ -104,7 +104,7 @@ public abstract class BaseDragLayer protected final Rect mHitRect = new Rect(); @ViewDebug.ExportedProperty(category = "launcher") - private final RectF mSystemGestureRegion = new RectF(); + protected final RectF mSystemGestureRegion = new RectF(); private int mTouchDispatchState = 0; protected final T mActivity; @@ -164,7 +164,7 @@ public abstract class BaseDragLayer return findActiveController(ev); } - private boolean isEventInLauncher(MotionEvent ev) { + protected boolean isEventWithinSystemGestureRegion(MotionEvent ev) { final float x = ev.getX(); final float y = ev.getY(); @@ -175,7 +175,8 @@ public abstract class BaseDragLayer private TouchController findControllerToHandleTouch(MotionEvent ev) { AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity); if (topView != null - && (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion()) + && (isEventWithinSystemGestureRegion(ev) + || topView.canInterceptEventsInSystemGestureRegion()) && topView.onControllerInterceptTouchEvent(ev)) { return topView; } @@ -287,7 +288,7 @@ public abstract class BaseDragLayer mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW | TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS; - if (isEventInLauncher(ev)) { + if (isEventWithinSystemGestureRegion(ev)) { mTouchDispatchState &= ~TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; } else { mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION;