Resolve issues caused by starting and stopping activitiy indicator quickly
MODIFY
components/ActivityIndicator/src/MDCActivityIndicator.m
components/ActivityIndicator/src/MDCActivityIndicator.m
@@ -207,6 +207,9 @@ static const CGFloat kSingleCycleRotation =
- (void)startAnimating {
if (_animatingOut) {
+ if ([_delegate respondsToSelector:@selector(activityIndicatorAnimationDidFinish:)]) {
+ [_delegate activityIndicatorAnimationDidFinish:self];
+ }
[self removeAnimations];
}
@@ -782,6 +785,11 @@ static const CGFloat kSingleCycleRotation =
[_strokeLayer removeAllAnimations];
[_outerRotationLayer removeAllAnimations];
+ // Reset current and latest progress, to ensure addProgressAnimationIfRequired adds a progress animation
+ // when returning from hidden.
+ _currentProgress = 0;
+ _lastProgress = 0;
+
// Reset cycle count to 0 rather than cycleStart to reflect default starting position (top).
_cycleCount = 0;
// However _animationInProgress represents the CATransaction that hasn't finished, so we leave it

Resolve issues caused by starting and stopping activitiy indicator quickly (#2053)