Loading quickstep/src/com/android/quickstep/views/RecentsView.java +8 −6 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); } } Loading src/com/android/launcher3/PagedView.java +6 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou @ViewDebug.ExportedProperty(category = "launcher") protected int mCurrentPage; // Difference between current scroll position and mCurrentPage's page scroll. Used to maintain // relative scroll position unchanged in updateCurrentPageScroll. Cleared when snapping to a // page. protected int mCurrentPageScrollDiff; @ViewDebug.ExportedProperty(category = "launcher") protected int mNextPage = INVALID_PAGE; Loading Loading @@ -247,7 +251,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // If the current page is invalid, just reset the scroll position to zero int newPosition = 0; if (0 <= mCurrentPage && mCurrentPage < getPageCount()) { newPosition = getScrollForPage(mCurrentPage); newPosition = getScrollForPage(mCurrentPage) + mCurrentPageScrollDiff; } mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition); mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0); Loading Loading @@ -452,6 +456,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou * to provide custom behavior during animation. */ protected void onPageEndTransition() { mCurrentPageScrollDiff = 0; AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage), AccessibilityEvent.TYPE_VIEW_FOCUSED, null); Loading Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +8 −6 Original line number Diff line number Diff line Loading @@ -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); Loading @@ -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(); } } Loading
src/com/android/launcher3/PagedView.java +6 −1 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou @ViewDebug.ExportedProperty(category = "launcher") protected int mCurrentPage; // Difference between current scroll position and mCurrentPage's page scroll. Used to maintain // relative scroll position unchanged in updateCurrentPageScroll. Cleared when snapping to a // page. protected int mCurrentPageScrollDiff; @ViewDebug.ExportedProperty(category = "launcher") protected int mNextPage = INVALID_PAGE; Loading Loading @@ -247,7 +251,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou // If the current page is invalid, just reset the scroll position to zero int newPosition = 0; if (0 <= mCurrentPage && mCurrentPage < getPageCount()) { newPosition = getScrollForPage(mCurrentPage); newPosition = getScrollForPage(mCurrentPage) + mCurrentPageScrollDiff; } mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition); mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0); Loading Loading @@ -452,6 +456,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou * to provide custom behavior during animation. */ protected void onPageEndTransition() { mCurrentPageScrollDiff = 0; AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage), AccessibilityEvent.TYPE_VIEW_FOCUSED, null); Loading