Skip to content

Commit

Permalink
[ProgressIndicator] Fixed incorrectly setting drawable's visibility w…
Browse files Browse the repository at this point in the history
…hen switching indeterminate mode for API19.

PiperOrigin-RevId: 318877353
  • Loading branch information
pekingme authored and ymarian committed Jun 29, 2020
1 parent eb2f52f commit 26021ed
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ public void initializeDrawables(
}

private void registerAnimationCallbacks() {

if (getProgressDrawable() != null && getIndeterminateDrawable() != null) {
// Registers the animation callback to switch indeterminate mode at the end of indeterminate
// animation.
Expand Down Expand Up @@ -1053,7 +1052,11 @@ public void onAnimationEnd(Drawable drawable) {
new Runnable() {
@Override
public void run() {
// Needs to explicitly set visibility of two drawables.
// ProgressBar.setIndeterminate cannot handle it properly for pre-lollipop.
getIndeterminateDrawable().setVisible(false, false);
setIndeterminate(false);
getProgressDrawable().setVisible(true, false);

// Resets progress bar to minimum value then updates to new progress.
setProgressCompat(0, /*animated=*/ false);
Expand Down

0 comments on commit 26021ed

Please sign in to comment.