Cleanup state properly when interacting during gesture nav transition

When the transition is canceled (e.g. when touching the nav bar during the transition), do the following:
- Abort the RecentsView scroll including the edge effects to ensure we get onSettledOnEndTarget() immediately.
- Jump to the current gesture end target state instead of the default rest state.

Test: Swipe up and to the left and hold to go to overview from an app, then swipe up to home during the transition; ensure that the touch down goes to overview rather than home, and subsequently that the swipe is respected and goes to home
Fixes: 189142339
Change-Id: Ie1d7dd05f45ab48968df7fdfd69fa1e1dda36d06
This commit is contained in:
Tony Wickham
2021-05-26 14:58:13 -07:00
parent 53ec9a4e06
commit f8d731a808
3 changed files with 25 additions and 2 deletions

View File

@@ -250,6 +250,15 @@ public abstract class PagedView<T extends View & PageIndicator> extends ViewGrou
forceFinishScroller(true);
}
/**
* Immediately finishes any overscroll effect and jumps to the end of the scroller animation.
*/
public void abortScrollerAnimation() {
mEdgeGlowLeft.finish();
mEdgeGlowRight.finish();
abortScrollerAnimation(true);
}
private void abortScrollerAnimation(boolean resetNextPage) {
mScroller.abortAnimation();
// We need to clean up the next page here to avoid computeScrollHelper from