diff options
author | Tony Wickham <twickham@google.com> | 2018-06-21 13:38:53 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2018-06-21 13:38:53 -0700 |
commit | 520ffec9d387c634c3dbcef1b510616bf29d66a3 (patch) | |
tree | 82801c561e30e22322d95db6484f83be99f27403 /src/com/android/launcher3/touch | |
parent | 56ded9c4ea230c64498dbbf8d4e0d24bb1d9cb8a (diff) | |
download | android_packages_apps_Trebuchet-520ffec9d387c634c3dbcef1b510616bf29d66a3.tar.gz android_packages_apps_Trebuchet-520ffec9d387c634c3dbcef1b510616bf29d66a3.tar.bz2 android_packages_apps_Trebuchet-520ffec9d387c634c3dbcef1b510616bf29d66a3.zip |
When controlling atomic components, bound to remaining progress
Before, we were just controlling the components as far as we had left,
which was fine since they are just a subtle effect anyway. But now that
we don't fade out until the very end, this means that long swiping from
home usually kept recents in the background during the entire swipe and
then abruptly disappear after letting go. Now we make sure the entire
atomic animation plays by the time we reach all apps, so recents will
fade out in all cases.
Bug: 79867407
Change-Id: I7cb6790d9055bc76b4b73ed761604042a308c987
Diffstat (limited to 'src/com/android/launcher3/touch')
-rw-r--r-- | src/com/android/launcher3/touch/AbstractStateChangeTouchController.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index d478d4865..55f850c8d 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -283,7 +283,9 @@ public abstract class AbstractStateChangeTouchController protected void updateProgress(float fraction) { mCurrentAnimation.setPlayFraction(fraction); if (mAtomicComponentsController != null) { - mAtomicComponentsController.setPlayFraction(fraction - mAtomicComponentsStartProgress); + // Make sure we don't divide by 0, and have at least a small runway. + float start = Math.min(mAtomicComponentsStartProgress, 0.9f); + mAtomicComponentsController.setPlayFraction((fraction - start) / (1 - start)); } maybeUpdateAtomicAnim(mFromState, mToState, fraction); } |