Prevent receive extra callbacks from AnimatorListener.

There will receive another onAnimationStart/onAnimationEnd callback
when calling ValueAnimator#end if the animation is not running, which
is not necessary if the animation was finished already.

Bug: 195736656
Test: atest SplashscreenTests
Change-Id: Ifbbf2f799e3e69624626b16e08f40b562fe483a8
This commit is contained in:
wilsonshih
2021-10-25 20:40:13 +08:00
parent 517f6aedc1
commit aeb283f9f6

View File

@@ -314,7 +314,7 @@ public class SplashscreenIconDrawableFactory {
@Override
public void stopAnimation() {
if (mIconAnimator != null) {
if (mIconAnimator != null && mIconAnimator.isRunning()) {
mIconAnimator.end();
}
}