Skip to content

Commit c4fee63

Browse files
Romain GuyAndroid Code Review
authored andcommitted
Merge "Fixing indeterminate progress bar animation state."
2 parents 2c07e7b + 52a3543 commit c4fee63

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/java/android/widget/ProgressBar.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,4 +934,20 @@ public void onRestoreInstanceState(Parcelable state) {
934934
setProgress(ss.progress);
935935
setSecondaryProgress(ss.secondaryProgress);
936936
}
937+
938+
@Override
939+
protected void onAttachedToWindow() {
940+
super.onAttachedToWindow();
941+
if (mIndeterminate) {
942+
startAnimation();
943+
}
944+
}
945+
946+
@Override
947+
protected void onDetachedFromWindow() {
948+
super.onDetachedFromWindow();
949+
if (mIndeterminate) {
950+
stopAnimation();
951+
}
952+
}
937953
}

0 commit comments

Comments
 (0)