From ee2e28fae8fc64c17981599397b7be947684e1c6 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 17 Aug 2021 16:43:12 -0700 Subject: [PATCH 1/2] Allow clipping individual direction of TaskView - Only clip the nav bar (taskbar), and always do that in tablets regardless of whether taskbar is stashed, so TaskView always have the same ratio (mocks: https://docs.google.com/presentation/d/1_3zQak_C9FzDPCcIdYagfUit4QyqfdRxetkim3dI9rY/edit#slide=id.ge211eb96a5_5_8) - When taskbar is present, don't use full thumbnail to avoid TaskView resizing in fullscreen: http://dr/file/d/18C8DSygPBU1gkmMQPPIIa2NqQESFurxW/view?resourcekey=0-8W79f31gstzI_1ZPpHulBQ - When taskbar is stashed, we still need full thumbnail to gradually crop out the taskbar in overview Test: Open Chrome, swipe up and ensure status bar inset stays in overview but taskbar stays clipped out from the onset. Bug: 190681228 Change-Id: I9d563572f2e6800e90d567c2bfae4528a126f24e --- .../quickstep/BaseActivityInterface.java | 34 ++++++++++++++----- .../quickstep/util/RecentsOrientedState.java | 14 ++++++-- .../quickstep/views/TaskThumbnailView.java | 32 +++++++++++------ .../com/android/quickstep/views/TaskView.java | 32 +++++++++++++---- 4 files changed, 83 insertions(+), 29 deletions(-) diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index e781160603..e2ef3bc66d 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -290,19 +290,35 @@ public abstract class BaseActivityInterface Date: Thu, 19 Aug 2021 14:17:30 +0000 Subject: [PATCH 2/2] Snap to current page's relative position after dismissal. Test: manual Fix: 196200215 Change-Id: Ic65313e2082ca2248e5860b77c438615c62b5581 --- .../android/quickstep/views/RecentsView.java | 133 +++++++++++++----- 1 file changed, 100 insertions(+), 33 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ef52b41d8f..095a3150ea 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2807,14 +2807,49 @@ public abstract class RecentsView= screenEnd - mPageSpacing; + // Rebalance only if there is a maximum gap between the task and the + // screen's edge; this ensures that rebalanced tasks are outside the + // visible screen. + if (mIsRtl) { + shouldRebalance = taskStart <= screenStart + mPageSpacing; + } else { + int screenEnd = + screenStart + mOrientationHandler.getMeasuredSize( + RecentsView.this); + int taskSize = (int) (mOrientationHandler.getMeasuredSize( + taskView) * taskView + .getSizeAdjustment(/*fullscreenEnabled=*/false)); + int taskEnd = taskStart + taskSize; + + shouldRebalance = taskEnd >= screenEnd - mPageSpacing; + } + + if (shouldRebalance) { + updateGridProperties(/*isTaskDismissal=*/ true, + highestVisibleTaskIndex); + updateScrollSynchronously(); + } } - if (shouldRebalance) { - updateGridProperties(/*isTaskDismissal=*/ true, - highestVisibleTaskIndex); - updateScrollSynchronously(); + // If snapping to another page due to indices rearranging, find the new + // index after dismissal & rearrange using the task view id. + if (taskViewIdToSnapTo != -1) { + pageToSnapTo = indexOfChild( + getTaskViewFromTaskViewId(taskViewIdToSnapTo)); } } - setCurrentPage(pageToSnapTo); dispatchScrollChanged(); } @@ -2879,11 +2924,33 @@ public abstract class RecentsView