Fix animation problem when swipeing up app to screen edge and release
- Consider scroll diff between currentPage and primary scroll when calculating adjacent page offset
- Removed setEnableFreeScroll call in onPrepareGestureAnimation that calls setCurrentPage and causes jumping
Fixes: 197012570
Fixes: 195740577
Test: Swipe up from app to end of screen, adjacent task should come from screen edge, and app should snap smoothly to position
Test: Swipe up from app, scroll immediately, free scroll should be enabled
Test: Swipe up immediately after quick switch, task thumbnails are loaded
Change-Id: Id88266634183dfcb18d5ba8a803883b7d6f50ab4
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index ef52b41..4d8c5d0 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -1996,7 +1996,6 @@
TaskViewSimulator[] taskViewSimulators) {
mCurrentGestureEndTarget = endTarget;
if (endTarget == GestureState.GestureEndTarget.RECENTS) {
- setEnableFreeScroll(true);
updateGridProperties();
}
@@ -3385,8 +3384,11 @@
boolean isStartShift;
if (midpointIndex > -1) {
// When there is a midpoint reference task, adjacent tasks have less distance to travel
- // to reach offscreen. Offset the task position to the task's starting point.
- int midpointScroll = getScrollForPage(midpointIndex);
+ // to reach offscreen. Offset the task position to the task's starting point, and offset
+ // by current page's scroll diff.
+ int midpointScroll = getScrollForPage(midpointIndex)
+ + mOrientationHandler.getPrimaryScroll(this) - getScrollForPage(mCurrentPage);
+
getPersistentChildPosition(midpointIndex, midpointScroll, taskPosition);
float midpointStart = mOrientationHandler.getStart(taskPosition);