[Overview Actions] Disable swiping for TaskView if it's in select mode.
This including swiping up to dismiss, down to launch app, left and right to switch apps.
Test: local
Bug: 139828243
Change-Id: Ib588c8725fb765097d03a5def719abdffd603708
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
index 947a861..f79ad25 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java
@@ -105,6 +105,10 @@
@Override
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
+ if ((ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL)
+ && mCurrentAnimation == null) {
+ clearState();
+ }
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
mNoIntercept = !canInterceptTouch();
if (mNoIntercept) {
@@ -125,6 +129,11 @@
TaskView view = mRecentsView.getTaskViewAt(i);
if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer()
.isEventOverView(view, ev)) {
+ // Disable swiping up and down if the task overlay is modal.
+ if (view.isTaskOverlayModal()) {
+ mTaskBeingDragged = null;
+ break;
+ }
mTaskBeingDragged = view;
if (!SysUINavigationMode.getMode(mActivity).hasGestures) {
// Don't allow swipe down to open if we don't support swipe up
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
index ec7cddf..eb3b190 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TaskOverlayFactory.java
@@ -87,5 +87,12 @@
* Called when the overlay is no longer used.
*/
public void reset() { }
+
+ /**
+ * Whether the overlay is modal, which means only tapping is enabled, but no swiping.
+ */
+ public boolean isOverlayModal() {
+ return false;
+ }
}
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index e34e74c..007493d 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -565,6 +565,13 @@
return isHandlingTouch() || shouldStealTouchFromSiblingsBelow(ev);
}
+ @Override
+ protected void determineScrollingStart(MotionEvent ev, float touchSlopScale) {
+ // If the task overlay is modal, should disable left and right swiping.
+ if (getCurrentPageTaskView() != null && !getCurrentPageTaskView().isTaskOverlayModal()) {
+ super.determineScrollingStart(ev, touchSlopScale);
+ }
+ }
protected boolean shouldStealTouchFromSiblingsBelow(MotionEvent ev) {
return true;
}
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
index dce92ff..79b9a9d 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/TaskView.java
@@ -251,6 +251,10 @@
}
}
+ public boolean isTaskOverlayModal() {
+ return mSnapshotView.getTaskOverlay().isOverlayModal();
+ }
+
public TaskMenuView getMenuView() {
return mMenuView;
}