summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/touch
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-06-21 13:38:53 -0700
committerTony Wickham <twickham@google.com>2018-06-21 13:38:53 -0700
commit520ffec9d387c634c3dbcef1b510616bf29d66a3 (patch)
tree82801c561e30e22322d95db6484f83be99f27403 /src/com/android/launcher3/touch
parent56ded9c4ea230c64498dbbf8d4e0d24bb1d9cb8a (diff)
downloadandroid_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.java4
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);
}