[Predictive Back] Remove OnBackPressedHandler

OnBackPressedHandler was mimicking android.window.OnBackAnimationCallback because later one was hidden API to T.

Now that we have moved to U, we can remove the former handler.

Test: manual
Bug: 272797556
Change-Id: Ic5302cfa0a6fb15c4a64bdf5dc331834b1f06f38
This commit is contained in:
Fengjiang Li
2023-03-15 10:50:50 -07:00
parent 11f873da0b
commit b7860bd85e
7 changed files with 48 additions and 106 deletions

View File

@@ -28,10 +28,12 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Outline;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Property;
import android.view.MotionEvent;
@@ -39,8 +41,8 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewOutlineProvider;
import android.view.animation.Interpolator;
import android.window.BackEvent;
import androidx.annotation.FloatRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
@@ -193,8 +195,9 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
}
@Override
public void onBackProgressed(@FloatRange(from = 0.0, to = 1.0) float progress) {
super.onBackProgressed(progress);
@TargetApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
public void onBackProgressed(BackEvent backEvent) {
final float progress = backEvent.getProgress();
float deceleratedProgress =
Interpolators.PREDICTIVE_BACK_DECELERATED_EASE.getInterpolation(progress);
mIsBackProgressing = progress > 0f;