mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 02:38:20 +00:00
Reset RecentsView#mNextPage when swiping to home
This ensures that we don't inadvertently update mCurrentPage to be mNextPage in computeScrollHelper(), which would in turn mess up calculations such as RecentsView#getHorizontalOffsetSize(). Also removed resetNextPage parameter from forceFinishScroller(), as resetNextPage was always passed as true anyway. Test: Swipe up and to the right to home, ensure adjacent page goes all the way off screen Fixes: 199927699 Change-Id: Iee1ffac10e5195f0c3a124a23b06d5411ecd7ba2
This commit is contained in:
@@ -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