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
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index d478d48..55f850c 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -283,7 +283,9 @@
     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);
     }