From 0b73d1014f1667a171d9f696dbfefed3a7a104c2 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 31 Aug 2021 20:23:36 -0700 Subject: [PATCH] Hide overview and app icon split option when appropriate Don't show app menu icon split option or overview action split option when current taskView is already in split or there are not at least 2 tasks with which to invoke split Fixes: 197245395 Test: Tested with small and large screen, dismissing tasks in overview, with and without GroupedTaskView as main running task Change-Id: I90cc3c39e4d94662cb87314a210d45d145b6e026 --- .../android/quickstep/TaskOverlayFactory.java | 7 +++++++ .../quickstep/views/OverviewActionsView.java | 1 - .../android/quickstep/views/RecentsView.java | 19 ++++++++++++++++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java index eb5c43fd37..978fb570ca 100644 --- a/quickstep/src/com/android/quickstep/TaskOverlayFactory.java +++ b/quickstep/src/com/android/quickstep/TaskOverlayFactory.java @@ -107,6 +107,13 @@ public class TaskOverlayFactory implements ResourceBasedOverride { public static void addSplitOptions(List outShortcuts, BaseDraggingActivity activity, TaskView taskView, DeviceProfile deviceProfile) { + int[] taskViewTaskIds = taskView.getTaskIds(); + boolean alreadyHasMultipleTasks = taskViewTaskIds[0] != -1 && + taskViewTaskIds[1] != -1; + if (alreadyHasMultipleTasks) { + return; + } + PagedOrientationHandler orientationHandler = taskView.getRecentsView().getPagedOrientationHandler(); List positions = diff --git a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java index 5d1c2022f9..1b28c53cad 100644 --- a/quickstep/src/com/android/quickstep/views/OverviewActionsView.java +++ b/quickstep/src/com/android/quickstep/views/OverviewActionsView.java @@ -223,7 +223,6 @@ public class OverviewActionsView extends FrameLayo mDp = dp; updateVerticalMargin(SysUINavigationMode.getMode(getContext())); requestLayout(); - setSplitButtonVisible(mDp.isTablet); } public void setSplitButtonVisible(boolean visible) { diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 810eccea8a..6947fc53ab 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1500,7 +1500,7 @@ public abstract class RecentsView mActionsView.setSplitButtonVisible(false)); } /** @@ -2933,6 +2932,7 @@ public abstract class RecentsView 1 + ); + } + /** * Returns all the tasks in the top row, without the focused task */ @@ -3745,7 +3758,6 @@ public abstract class RecentsView