Skip to content

Commit

Permalink
[ProgressIndicator] Fixed determinate drawable not fully shown when s…
Browse files Browse the repository at this point in the history
…witched from indeterminate mode for the second time in SDK 19/21/23.

PiperOrigin-RevId: 350786230
(cherry picked from commit 712f5f3)
  • Loading branch information
pekingme authored and ikim24 committed Jan 14, 2021
1 parent 46d8fba commit 04ae5d7
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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.
Expand Down

0 comments on commit 04ae5d7

Please sign in to comment.