diff options
author | Tony <twickham@google.com> | 2019-05-21 19:30:59 -0700 |
---|---|---|
committer | Tony <twickham@google.com> | 2019-05-21 20:27:55 -0700 |
commit | e246dff69f1d0751ee760b442d02c90f088f3fb9 (patch) | |
tree | 7355cfef1a7aa60e48a1567d1a20f18649263593 /quickstep | |
parent | 0ef504aa71c85e36fc03300c4649adc503113920 (diff) | |
download | android_packages_apps_Trebuchet-e246dff69f1d0751ee760b442d02c90f088f3fb9.tar.gz android_packages_apps_Trebuchet-e246dff69f1d0751ee760b442d02c90f088f3fb9.tar.bz2 android_packages_apps_Trebuchet-e246dff69f1d0751ee760b442d02c90f088f3fb9.zip |
Fix some issues with shelf jumping/duration
Don't use OvershootParams for 0 button mode, since that interpolator
assumes the shelf is moving in conjunction with recents/app window.
Instead, use OVERSHOOT_1_2 like we do when not flinging.
Also bound the duration when entering recents, since scroller
duration could be 750ms if we are snapping to the current page.
Now we cap at MAX_SWIPE_DURATION (350ms). This case is most likely
to be hit when ending a slow swipe near the final recents scale,
since in that case duration is close to 0 and the scroller duration
is taken instead.
Test:
- Artificially always detect a pause, fling up in 0 button mode;
ensure shelf doesn't jump
- Either with the above artifical change in 0 button, or 2 button
mode, end a swipe to recents near its final scale with a slight
scroll to the right; ensure duration is 350 instead of 750
Bug: 132283018
Bug: 127783075
Change-Id: I8d5fbd0b30af21b9587fba47d141ba90b3b6e778
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index d69262e2c..2ff5c0c6a 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -902,7 +902,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> float minFlingVelocity = mContext.getResources() .getDimension(R.dimen.quickstep_fling_min_velocity); if (Math.abs(endVelocity) > minFlingVelocity && mTransitionDragLength > 0) { - if (endTarget == RECENTS) { + if (endTarget == RECENTS && mMode != Mode.NO_BUTTON) { Interpolators.OvershootParams overshoot = new Interpolators.OvershootParams( startShift, endShift, endShift, velocityPxPerMs.y, mTransitionDragLength); @@ -918,6 +918,10 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> // derivative of the scroll interpolator at zero, ie. 2. long baseDuration = Math.round(Math.abs(distanceToTravel / velocityPxPerMs.y)); duration = Math.min(MAX_SWIPE_DURATION, 2 * baseDuration); + + if (endTarget == RECENTS) { + interpolator = OVERSHOOT_1_2; + } } } } @@ -932,7 +936,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> } else if (endTarget == RECENTS) { mLiveTileOverlay.startIconAnimation(); if (mRecentsView != null) { - duration = Math.max(duration, mRecentsView.getScroller().getDuration()); + duration = Utilities.boundToRange(mRecentsView.getScroller().getDuration(), + duration, MAX_SWIPE_DURATION); } if (mMode == Mode.NO_BUTTON) { setShelfState(ShelfAnimState.OVERVIEW, interpolator, duration); |