Merge "Fixing indeterminate progress bar animation state."

This commit is contained in:
Romain Guy
2010-05-15 12:34:05 -07:00
committed by Android Code Review

View File

@@ -934,4 +934,20 @@ public class ProgressBar extends View {
setProgress(ss.progress);
setSecondaryProgress(ss.secondaryProgress);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
if (mIndeterminate) {
startAnimation();
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (mIndeterminate) {
stopAnimation();
}
}
}