Use FlingOnBackAnimationCallback for predictive back

Use FlingOnBackAnimationCallback to get automatically interpolated progress and out-of-the-box support for back gesture flings.

Bug: 362938401
Test: Manual, i.e. testing launcher predictive back cases (all apps, widget-picker)
Flag: com.android.window.flags.predictive_back_timestamp_api
Change-Id: I35806dbf005eb6fce97327d26c1e75bca60c2c77
This commit is contained in:
Johannes Gallmann committed 2024-10-30 13:32:15 +00:00
1 parent d626cdd727
commit 600c1af779
4 files changed
+14 -15

No files matched your search

@@ -45,7 +45,6 @@ import android.view.animation.Interpolator;
import androidx.annotation.FloatRange;
import androidx.annotation.Nullable;
import com.android.app.animation.Interpolators;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.Launcher;
@@ -280,10 +279,9 @@ public class AllAppsTransitionController
return;
}
float deceleratedProgress = Interpolators.BACK_GESTURE.getInterpolation(backProgress);
float scaleProgress = ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE
+ (1 - ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE)
* (1 - deceleratedProgress);
* (1 - backProgress);
mAllAppScale.updateValue(scaleProgress);
}