diff --git a/quickstep/src/com/android/launcher3/WidgetPickerActivity.java b/quickstep/src/com/android/launcher3/WidgetPickerActivity.java index 955388dec7..81fc7f2aa7 100644 --- a/quickstep/src/com/android/launcher3/WidgetPickerActivity.java +++ b/quickstep/src/com/android/launcher3/WidgetPickerActivity.java @@ -52,6 +52,7 @@ import com.android.launcher3.widget.model.WidgetsListBaseEntriesBuilder; import com.android.launcher3.widget.model.WidgetsListBaseEntry; import com.android.launcher3.widget.picker.WidgetsFullSheet; import com.android.launcher3.widget.picker.model.WidgetPickerDataProvider; +import com.android.systemui.animation.back.FlingOnBackAnimationCallback; import java.util.ArrayList; import java.util.HashSet; @@ -356,12 +357,12 @@ public class WidgetPickerActivity extends BaseActivity { /** * Animation callback for different predictive back animation states for the widget picker. */ - private class BackAnimationCallback implements OnBackAnimationCallback { + private class BackAnimationCallback extends FlingOnBackAnimationCallback { @Nullable OnBackAnimationCallback mActiveOnBackAnimationCallback; @Override - public void onBackStarted(@NonNull BackEvent backEvent) { + public void onBackStartedCompat(@NonNull BackEvent backEvent) { if (mActiveOnBackAnimationCallback != null) { mActiveOnBackAnimationCallback.onBackCancelled(); } @@ -372,7 +373,7 @@ public class WidgetPickerActivity extends BaseActivity { } @Override - public void onBackInvoked() { + public void onBackInvokedCompat() { if (mActiveOnBackAnimationCallback == null) { return; } @@ -381,7 +382,7 @@ public class WidgetPickerActivity extends BaseActivity { } @Override - public void onBackProgressed(@NonNull BackEvent backEvent) { + public void onBackProgressedCompat(@NonNull BackEvent backEvent) { if (mActiveOnBackAnimationCallback == null) { return; } @@ -389,7 +390,7 @@ public class WidgetPickerActivity extends BaseActivity { } @Override - public void onBackCancelled() { + public void onBackCancelledCompat() { if (mActiveOnBackAnimationCallback == null) { return; } diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 228dc9101c..f9c788e781 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -189,6 +189,7 @@ import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.RecentsViewContainer; import com.android.quickstep.views.TaskView; +import com.android.systemui.animation.back.FlingOnBackAnimationCallback; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.unfold.RemoteUnfoldSharedComponent; @@ -899,12 +900,12 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, protected void registerBackDispatcher() { getOnBackInvokedDispatcher().registerOnBackInvokedCallback( OnBackInvokedDispatcher.PRIORITY_DEFAULT, - new OnBackAnimationCallback() { + new FlingOnBackAnimationCallback() { @Nullable OnBackAnimationCallback mActiveOnBackAnimationCallback; @Override - public void onBackStarted(@NonNull BackEvent backEvent) { + public void onBackStartedCompat(@NonNull BackEvent backEvent) { if (mActiveOnBackAnimationCallback != null) { mActiveOnBackAnimationCallback.onBackCancelled(); } @@ -914,7 +915,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE) @Override - public void onBackInvoked() { + public void onBackInvokedCompat() { // Recreate mActiveOnBackAnimationCallback if necessary to avoid NPE // because: // 1. b/260636433: In 3-button-navigation mode, onBackStarted() is not @@ -930,7 +931,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, } @Override - public void onBackProgressed(@NonNull BackEvent backEvent) { + public void onBackProgressedCompat(@NonNull BackEvent backEvent) { if (!FeatureFlags.IS_STUDIO_BUILD && mActiveOnBackAnimationCallback == null) { return; @@ -939,7 +940,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, } @Override - public void onBackCancelled() { + public void onBackCancelledCompat() { if (!FeatureFlags.IS_STUDIO_BUILD && mActiveOnBackAnimationCallback == null) { return; diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index c6852e015c..39ca616862 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -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); } diff --git a/src/com/android/launcher3/views/AbstractSlideInView.java b/src/com/android/launcher3/views/AbstractSlideInView.java index 85aad8982c..65d02d0177 100644 --- a/src/com/android/launcher3/views/AbstractSlideInView.java +++ b/src/com/android/launcher3/views/AbstractSlideInView.java @@ -298,8 +298,7 @@ public abstract class AbstractSlideInView @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); } /**