Have AlphaUpdateListener update visibility in onAnimationEnd()

Previously we were only updating visibility in onAnimationSuccess(), which doesn't handle the canceled case.

Test: swipe up from nav bar twice in all apps, ensure all apps is invisible/non-interactable
Bug: 190315266
Change-Id: Ic59e6d4b404de4ee2d17c45d6fa59e2aee70c65f
This commit is contained in:
Tony Wickham
2021-06-07 14:56:12 -07:00
parent 93c0cfadb1
commit 26ab4621ce

View File

@@ -17,6 +17,7 @@
package com.android.launcher3.anim;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.view.View;
@@ -25,7 +26,7 @@ import android.view.ViewGroup;
/**
* A convenience class to update a view's visibility state after an alpha animation.
*/
public class AlphaUpdateListener extends AnimationSuccessListener
public class AlphaUpdateListener extends AnimatorListenerAdapter
implements AnimatorUpdateListener {
public static final float ALPHA_CUTOFF_THRESHOLD = 0.01f;
@@ -41,7 +42,7 @@ public class AlphaUpdateListener extends AnimationSuccessListener
}
@Override
public void onAnimationSuccess(Animator animator) {
public void onAnimationEnd(Animator animator) {
updateVisibility(mView);
}