Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added customBackgroundColor property #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions MTStatusBarOverlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ typedef enum MTMessageType {
// the delegate of the overlay
@property (nonatomic, unsafe_unretained) id<MTStatusBarOverlayDelegate> delegate;
@property(nonatomic, strong) UIColor *customTextColor;
@property(nonatomic, strong) UIColor *customBackgroundColor;
//===========================================================
#pragma mark -
#pragma mark Class Methods
Expand Down Expand Up @@ -196,4 +197,10 @@ typedef enum MTMessageType {
// is called when an immediate message gets posted and therefore messages in the queue get lost
// it tells the delegate the lost messages and the delegate can then enqueue the messages again
- (void)statusBarOverlayDidClearMessageQueue:(NSArray *)messageQueue;
// is called to ask for custom text color for a specific message type.
- (void)statusBarOverlay:(MTStatusBarOverlay*)overlay backgroundColorForMessageType:(MTMessageType)messageType;
// is called to ask for custom background color for a specific message type.
- (void)statusBarOverlay:(MTStatusBarOverlay*)overlay textColorForMessageType:(MTMessageType)messageType;
// is called to ask for custom shadow coor for a specific message type.
- (void)statusBarOverlay:(MTStatusBarOverlay*)overlay shadowColorForMessageType:(MTMessageType)messageType;
@end
4 changes: 2 additions & 2 deletions MTStatusBarOverlay.m
Original file line number Diff line number Diff line change
Expand Up @@ -1197,12 +1197,12 @@ - (void)setStatusBarBackgroundForStyle:(UIStatusBarStyle)style {
} else {
self.statusBarBackgroundImageView.image = [self.defaultStatusBarImage stretchableImageWithLeftCapWidth:2.0f topCapHeight:0.0f];
}
statusBarBackgroundImageView_.backgroundColor = [UIColor clearColor];
statusBarBackgroundImageView_.backgroundColor = self.customBackgroundColor ?: [UIColor clearColor];
}
// black status bar? -> no image
else {
self.statusBarBackgroundImageView.image = nil;
statusBarBackgroundImageView_.backgroundColor = [UIColor blackColor];
statusBarBackgroundImageView_.backgroundColor = self.customBackgroundColor ?: [UIColor blackColor];
}
}

Expand Down