From 6c4eced65de09441aac6d120e4eab9c4c4c827b9 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 11 Apr 2018 17:16:44 -0700 Subject: [PATCH] Don't allow swiping down on task to launch when swipe up is disabled Bug: 77921295 Change-Id: I6800f81a5f3edcbed2db1138375f78c5900c6cd4 --- .../uioverrides/TaskViewTouchController.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/TaskViewTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/TaskViewTouchController.java index 4c9fd5ae38..5765256290 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/TaskViewTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/TaskViewTouchController.java @@ -33,6 +33,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; import com.android.launcher3.util.PendingAnimation; import com.android.launcher3.util.TouchController; import com.android.launcher3.views.BaseDragLayer; +import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; @@ -117,11 +118,18 @@ public abstract class TaskViewTouchController TaskView view = mRecentsView.getPageAt(i); if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer() .isEventOverView(view, ev)) { - // The task can be dragged up to dismiss it, - // and down to open if it's the current page. mTaskBeingDragged = view; - directionsToDetectScroll = i == mRecentsView.getCurrentPage() - ? SwipeDetector.DIRECTION_BOTH : SwipeDetector.DIRECTION_POSITIVE; + if (!OverviewInteractionState.getInstance(mActivity) + .isSwipeUpGestureEnabled()) { + // Don't allow swipe down to open if we don't support swipe up + // to enter overview. + directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE; + } else { + // The task can be dragged up to dismiss it, + // and down to open if it's the current page. + directionsToDetectScroll = i == mRecentsView.getCurrentPage() + ? SwipeDetector.DIRECTION_BOTH : SwipeDetector.DIRECTION_POSITIVE; + } break; } }