diff --git a/lib/java/com/google/android/material/progressindicator/DrawableWithAnimatedVisibilityChange.java b/lib/java/com/google/android/material/progressindicator/DrawableWithAnimatedVisibilityChange.java index 723214381ca..8917c265600 100644 --- a/lib/java/com/google/android/material/progressindicator/DrawableWithAnimatedVisibilityChange.java +++ b/lib/java/com/google/android/material/progressindicator/DrawableWithAnimatedVisibilityChange.java @@ -259,10 +259,8 @@ boolean setVisibleInternal(boolean visible, boolean restart, boolean animate) { ValueAnimator animatorInAction = visible ? showAnimator : hideAnimator; if (!animate) { - if (animatorInAction.isRunning()) { - // Show/hide animation should fast-forward to the end without callbacks. - endAnimatorWithoutCallbacks(animatorInAction); - } + // Show/hide animation should fast-forward to the end without callbacks. + endAnimatorWithoutCallbacks(animatorInAction); // Immediately updates the drawable's visibility without animation if not desired. return super.setVisible(visible, DEFAULT_DRAWABLE_RESTART); } @@ -282,12 +280,6 @@ boolean setVisibleInternal(boolean visible, boolean restart, boolean animate) { endAnimatorWithoutCallbacks(animatorInAction); return changed; } - if (!animate) { - // This triggers onAnimationStart() callbacks for showing and onAnimationEnd() callbacks for - // hiding. It also fast-forwards the animator properties to the end state. - animatorInAction.end(); - return changed; - } if (restart || VERSION.SDK_INT < 19 || !animatorInAction.isPaused()) { // Starts/restarts the animator if requested or not eligible to resume.