Skip to content

Commit

Permalink
Do not decrease progress during one progress-run
Browse files Browse the repository at this point in the history
  • Loading branch information
myell0w committed Nov 20, 2011
1 parent 92b757c commit 1016770
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion MTStatusBarOverlay.m
Expand Up @@ -886,7 +886,12 @@ - (void)rotateToStatusBarFrame:(NSValue *)statusBarFrameValue {


- (void)setProgress:(double)progress { - (void)setProgress:(double)progress {
// bound progress to 0.0 - 1.0 // bound progress to 0.0 - 1.0
progress_ = MAX(0.0, MIN(progress, 1.0)); progress = MAX(0.0, MIN(progress, 1.0));

// do not decrease progress if it is no reset
if (progress == 0.0 || progress > progress_) {
progress_ = progress;
}


// update UI on main thread // update UI on main thread
[self performSelectorOnMainThread:@selector(updateProgressViewSizeForLabel:) withObject:self.visibleStatusLabel waitUntilDone:NO]; [self performSelectorOnMainThread:@selector(updateProgressViewSizeForLabel:) withObject:self.visibleStatusLabel waitUntilDone:NO];
Expand Down

0 comments on commit 1016770

Please sign in to comment.