Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,15 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { onDestroy(true); 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 @Override protected boolean canFindActiveController() { protected boolean canFindActiveController() { // Unlike super class, we want to be able to find controllers when touches occur in the // Unlike super class, we want to be able to find controllers when touches occur in the Loading src/com/android/launcher3/views/BaseDragLayer.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -104,7 +104,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> protected final Rect mHitRect = new Rect(); protected final Rect mHitRect = new Rect(); @ViewDebug.ExportedProperty(category = "launcher") @ViewDebug.ExportedProperty(category = "launcher") private final RectF mSystemGestureRegion = new RectF(); protected final RectF mSystemGestureRegion = new RectF(); private int mTouchDispatchState = 0; private int mTouchDispatchState = 0; protected final T mActivity; protected final T mActivity; Loading Loading @@ -164,7 +164,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> return findActiveController(ev); return findActiveController(ev); } } private boolean isEventInLauncher(MotionEvent ev) { protected boolean isEventWithinSystemGestureRegion(MotionEvent ev) { final float x = ev.getX(); final float x = ev.getX(); final float y = ev.getY(); final float y = ev.getY(); Loading @@ -175,7 +175,8 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> private TouchController findControllerToHandleTouch(MotionEvent ev) { private TouchController findControllerToHandleTouch(MotionEvent ev) { AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity); AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity); if (topView != null if (topView != null && (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion()) && (isEventWithinSystemGestureRegion(ev) || topView.canInterceptEventsInSystemGestureRegion()) && topView.onControllerInterceptTouchEvent(ev)) { && topView.onControllerInterceptTouchEvent(ev)) { return topView; return topView; } } Loading Loading @@ -287,7 +288,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW | TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS; | TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS; if (isEventInLauncher(ev)) { if (isEventWithinSystemGestureRegion(ev)) { mTouchDispatchState &= ~TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; mTouchDispatchState &= ~TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; } else { } else { mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; Loading Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -146,6 +146,15 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { onDestroy(true); 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 @Override protected boolean canFindActiveController() { protected boolean canFindActiveController() { // Unlike super class, we want to be able to find controllers when touches occur in the // Unlike super class, we want to be able to find controllers when touches occur in the Loading
src/com/android/launcher3/views/BaseDragLayer.java +5 −4 Original line number Original line Diff line number Diff line Loading @@ -104,7 +104,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> protected final Rect mHitRect = new Rect(); protected final Rect mHitRect = new Rect(); @ViewDebug.ExportedProperty(category = "launcher") @ViewDebug.ExportedProperty(category = "launcher") private final RectF mSystemGestureRegion = new RectF(); protected final RectF mSystemGestureRegion = new RectF(); private int mTouchDispatchState = 0; private int mTouchDispatchState = 0; protected final T mActivity; protected final T mActivity; Loading Loading @@ -164,7 +164,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> return findActiveController(ev); return findActiveController(ev); } } private boolean isEventInLauncher(MotionEvent ev) { protected boolean isEventWithinSystemGestureRegion(MotionEvent ev) { final float x = ev.getX(); final float x = ev.getX(); final float y = ev.getY(); final float y = ev.getY(); Loading @@ -175,7 +175,8 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> private TouchController findControllerToHandleTouch(MotionEvent ev) { private TouchController findControllerToHandleTouch(MotionEvent ev) { AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity); AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity); if (topView != null if (topView != null && (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion()) && (isEventWithinSystemGestureRegion(ev) || topView.canInterceptEventsInSystemGestureRegion()) && topView.onControllerInterceptTouchEvent(ev)) { && topView.onControllerInterceptTouchEvent(ev)) { return topView; return topView; } } Loading Loading @@ -287,7 +288,7 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW | TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS; | TOUCH_DISPATCHING_TO_VIEW_IN_PROGRESS; if (isEventInLauncher(ev)) { if (isEventWithinSystemGestureRegion(ev)) { mTouchDispatchState &= ~TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; mTouchDispatchState &= ~TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; } else { } else { mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; mTouchDispatchState |= TOUCH_DISPATCHING_FROM_VIEW_GESTURE_REGION; Loading