Merge "Use FlingOnBackAnimationCallback for predictive back" into main

This commit is contained in:
Johannes Gallmann
2024-11-11 08:29:47 +00:00
committed by Android (Google) Code Review
4 changed files with 14 additions and 15 deletions
@@ -43,7 +43,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;
@@ -277,10 +276,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);
}
@@ -298,8 +298,7 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public void onBackProgressed(BackEvent backEvent) {
final float progress = backEvent.getProgress();
float deceleratedProgress = Interpolators.BACK_GESTURE.getInterpolation(progress);
mSwipeToDismissProgress.updateValue(deceleratedProgress);
mSwipeToDismissProgress.updateValue(progress);
}
/**