Permalink
Browse files

Don't animate to progress 0

  • Loading branch information...
1 parent 1b4c491 commit 5a19db33ac592448784ebf44c42396d74572bfe1 @myell0w myell0w committed Feb 24, 2011
Showing with 5 additions and 4 deletions.
  1. +5 −4 MTStatusBarOverlay.m
View
@@ -1257,10 +1257,11 @@ - (void)updateProgressViewSizeForLabel:(UILabel *)label {
// it "shrinks" to the right with increased progress to reveal more
// text under it
self.progressView.hidden = NO;
- [UIView animateWithDuration:kUpdateProgressViewDuration animations:^{
- self.progressView.frame = CGRectMake(x, self.progressView.frame.origin.y,
- self.backgroundView.frame.size.width-x, self.progressView.frame.size.height);
- }];
+ [UIView animateWithDuration:self.progress > 0.0 ? kUpdateProgressViewDuration : 0.0
+ animations:^{
+ self.progressView.frame = CGRectMake(x, self.progressView.frame.origin.y,
+ self.backgroundView.frame.size.width-x, self.progressView.frame.size.height);
+ }];
} else {
self.progressView.hidden = YES;
}

0 comments on commit 5a19db3

Please sign in to comment.