Merge "Reland "Snap to relative position to snappd task when dismissing"" into sc-v2-dev am: eba399c130 am: 94ab05138f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15299582

Change-Id: Idb1bb656ee9ce79dea91e108dfc164b1014b9821
This commit is contained in:
TreeHugger Robot authored and Automerger Merge Worker committed 2021-07-15 16:54:43 +00:00
commit fbfb5d691f
2 files changed
+14 -7

No files matched your search

@@ -2504,12 +2504,15 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
resetTaskVisuals();
int pageToSnapTo = mCurrentPage;
if (finalNextFocusedTaskView != null) {
pageToSnapTo = indexOfChild(finalNextFocusedTaskView);
}
if (dismissedIndex < pageToSnapTo || pageToSnapTo == (taskCount - 1)) {
if ((dismissedIndex < pageToSnapTo && !showAsGrid)
|| pageToSnapTo == taskCount - 1) {
pageToSnapTo -= 1;
}
if (showAsGrid) {
int primaryScroll = mOrientationHandler.getPrimaryScroll(RecentsView.this);
int currentPageScroll = getScrollForPage(pageToSnapTo);
mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
}
removeViewInLayout(dismissedTaskView);
mTopRowIdSet.remove(dismissedTaskId);
@@ -2522,12 +2525,11 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mFocusedTaskId = finalNextFocusedTaskView.getTaskId();
mTopRowIdSet.remove(mFocusedTaskId);
finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
setCurrentPage(pageToSnapTo);
}
updateTaskSize(true);
// Update scroll and snap to page.
updateScrollSynchronously();
snapToPageImmediately(pageToSnapTo);
setCurrentPage(pageToSnapTo);
dispatchScrollChanged();
}
}