Skip to content
Browse files

Improved temporary hide-mechanism

  • Loading branch information...
1 parent 6e2ac81 commit f791b75967a8cd6cd1e138e223387a7866fd7ab0 @myell0w committed Nov 17, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 MTStatusBarOverlay.m
View
10 MTStatusBarOverlay.m
@@ -580,6 +580,10 @@ - (void)postImmediateMessage:(NSString *)message type:(MTMessageType)messageType
//===========================================================
- (void)showNextMessage {
+ if (self.forcedToHide) {
+ return;
+ }
+
// if there is no next message to show overlay is not active anymore
@synchronized(self.messageQueue) {
if([self.messageQueue count] < 1) {
@@ -639,7 +643,7 @@ - (void)showNextMessage {
[self updateUIForMessageType:messageType duration:duration];
// if status bar is currently hidden, show it unless it is forced to hide
- if (self.reallyHidden && !self.forcedToHide) {
+ if (self.reallyHidden) {
// clear currently visible status label
self.visibleStatusLabel.text = @"";
@@ -760,14 +764,16 @@ - (void)hideTemporary {
}
// this shows the status bar overlay, if there is text to show
- (void)show {
+ self.forcedToHide = NO;
+
if (self.visibleStatusLabel.text.length > 0) {
// show status bar overlay with animation
[UIView animateWithDuration:self.shrinked ? 0. : kAppearAnimationDuration animations:^{
[self setHidden:NO useAlpha:YES];
}];
}
- self.forcedToHide = NO;
+ [self showNextMessage];
}
//===========================================================

0 comments on commit f791b75

Please sign in to comment.
Something went wrong with that request. Please try again.