Reset RecentsView#mNextPage when swiping to home am: d552132d0b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15828992 Change-Id: I9c8c0ce872cd205a25ca3154b842b9cc98a9c578
This commit is contained in:
@@ -197,7 +197,7 @@ public class StaggeredWorkspaceAnim {
|
||||
launcher.getStateManager().createAtomicAnimation(BACKGROUND_APP, NORMAL, config).start();
|
||||
|
||||
// Stop scrolling so that it doesn't interfere with the translation offscreen.
|
||||
launcher.<RecentsView>getOverviewPanel().getScroller().forceFinished(true);
|
||||
launcher.<RecentsView>getOverviewPanel().forceFinishScroller();
|
||||
|
||||
if (animateOverviewScrim) {
|
||||
launcher.getWorkspace().getStateTransitionAnimation()
|
||||
|
||||
@@ -120,7 +120,7 @@ public class WorkspaceRevealAnim {
|
||||
launcher.getStateManager().createAtomicAnimation(BACKGROUND_APP, NORMAL, config).start();
|
||||
|
||||
// Stop scrolling so that it doesn't interfere with the translation offscreen.
|
||||
launcher.<RecentsView>getOverviewPanel().getScroller().forceFinished(true);
|
||||
launcher.<RecentsView>getOverviewPanel().forceFinishScroller();
|
||||
|
||||
if (animateOverviewScrim) {
|
||||
launcher.getWorkspace().getStateTransitionAnimation()
|
||||
|
||||
@@ -254,7 +254,7 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
}
|
||||
mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition);
|
||||
mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0);
|
||||
forceFinishScroller(true);
|
||||
forceFinishScroller();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,14 +276,16 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
|
||||
}
|
||||
}
|
||||
|
||||
private void forceFinishScroller(boolean resetNextPage) {
|
||||
/**
|
||||
* Immediately finishes any in-progress scroll, maintaining the current position. Also sets
|
||||
* mNextPage = INVALID_PAGE and calls pageEndTransition().
|
||||
*/
|
||||
public void forceFinishScroller() {
|
||||
mScroller.forceFinished(true);
|
||||
// We need to clean up the next page here to avoid computeScrollHelper from
|
||||
// updating current page on the pass.
|
||||
if (resetNextPage) {
|
||||
mNextPage = INVALID_PAGE;
|
||||
pageEndTransition();
|
||||
}
|
||||
mNextPage = INVALID_PAGE;
|
||||
pageEndTransition();
|
||||
}
|
||||
|
||||
private int validateNewPage(int newPage) {
|
||||
|
||||
Reference in New Issue
Block a user