Skip to content

Commit

Permalink
[ProgressIndicator] Fixed incorrect visibility change when the compon…
Browse files Browse the repository at this point in the history
…ent's parent is not visible.

PiperOrigin-RevId: 322771684
  • Loading branch information
pekingme authored and dsn5ft committed Jul 23, 2020
1 parent 5229b3f commit ea9cce8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ protected void onAttachedToWindow() {
protected void onDetachedFromWindow() {
// Removes the delayedHide runnable from the queue if it has been scheduled.
removeCallbacks(delayedHide);
getCurrentDrawable().setVisible(/*visible=*/ false, /*restart=*/ false);
getCurrentDrawable().hideNow();
unregisterAnimationCallbacks();
super.onDetachedFromWindow();
}
Expand Down Expand Up @@ -1005,9 +1005,9 @@ public void onAnimationEnd(Drawable drawable) {
@Override
public void onAnimationEnd(Drawable drawable) {
super.onAnimationEnd(drawable);
if (!isIndeterminateModeChangeRequested) {
if (!isIndeterminateModeChangeRequested && visibleToUser()) {
// Don't hide the component if under transition from indeterminate mode to
// determinate mode.
// determinate mode or the component is current not visible to users.
setVisibility(INVISIBLE);
}
}
Expand Down

0 comments on commit ea9cce8

Please sign in to comment.