only change the status bar background color

This commit is contained in:
panxi 2019-04-17 11:17:44 -04:00
parent c1fe2c617d
commit a254e7d882
4 changed files with 9 additions and 10 deletions

View File

@ -93,7 +93,7 @@ static NSTimeInterval const HandScrollAnimationTiming = 7.f;
BOOL automaticInset = NO;
if (@available(iOS 11.0, *)) {
automaticInset = self.scrollView.contentInsetAdjustmentBehavior == UIScrollViewContentInsetAdjustmentAutomatic;
automaticInset = self.navigationController && self.scrollView.contentInsetAdjustmentBehavior == UIScrollViewContentInsetAdjustmentAutomatic;
}
// Takes into account the navigation bar.

View File

@ -881,7 +881,7 @@ CGFloat const PanelAnimationDuration = 0.2;
return self.topAlertView.statusBarStyle;
} else {
UIStatusBarStyle style = [self getDefaultStatusBarStyle];
[self.topAlertView resetDefaultStatusBarStyle:style backgroundColor:[self getDefaultStatusBarBackgroundColor]];
[self.topAlertView resetDefaultBackgroundColor:[self getDefaultStatusBarBackgroundColor] basedOnStatusBarStyle:[self getDefaultStatusBarStyle]];
return style;
}
}

View File

@ -41,8 +41,8 @@
- (void)expandStatusBarView;
- (void)collapseStatusBarView;
//reset status bar color to default based on splitview
- (void)resetDefaultStatusBarStyle:(UIStatusBarStyle)style backgroundColor:(nullable UIColor *)backgroundColor;
//reset status bar background color based on style
- (void)resetDefaultBackgroundColor:(nullable UIColor *)backgroundColor basedOnStatusBarStyle:(UIStatusBarStyle)style;
// Can be subclassed for custom views.
- (nonnull MVMCoreUITopAlertBaseView *)topAlertViewForTopAlertObject:(nullable MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nonnull id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate statusBarColor:(UIColor *_Nullable *_Nullable)statusBarColor;

View File

@ -204,8 +204,7 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed.";
completionHandler(finished);
weakSelf.topAlertObject = nil;
[MVMCoreDispatchUtility performBlockOnMainThread:^{
MVMCoreUISplitViewController *mainsplit = [MVMCoreUISplitViewController mainSplitViewController];
[weakSelf resetDefaultStatusBarStyle:[mainsplit getDefaultStatusBarStyle] backgroundColor:[mainsplit getDefaultStatusBarBackgroundColor]];
[weakSelf setStatusBarColor:[UIColor whiteColor] statusBarStyle:UIStatusBarStyleDefault];
}];
}];
}];
@ -245,15 +244,15 @@ NSString * const MFAccTopAlertClosed = @"Top alert notification is closed.";
}];
}
- (void)resetDefaultStatusBarStyle:(UIStatusBarStyle)style backgroundColor:(UIColor *)backgroundColor {
- (void)resetDefaultBackgroundColor:(UIColor *)backgroundColor basedOnStatusBarStyle:(UIStatusBarStyle)style {
UIColor *defaultStatusBarBackgroundColor = backgroundColor;
if (!defaultStatusBarBackgroundColor) {
defaultStatusBarBackgroundColor = style == UIStatusBarStyleDefault ? [UIColor whiteColor] : [UIColor blackColor];
}
if (!self.topAlertObject) {
//style or color doens't match the current default value
if (style != self.statusBarStyle || !CGColorEqualToColor(defaultStatusBarBackgroundColor.CGColor, self.statusBarView.backgroundColor.CGColor)) {
[self setStatusBarColor:defaultStatusBarBackgroundColor statusBarStyle:style];
//color doens't match the current default value
if (!CGColorEqualToColor(defaultStatusBarBackgroundColor.CGColor, self.statusBarView.backgroundColor.CGColor)) {
self.statusBarView.backgroundColor = defaultStatusBarBackgroundColor;
}
}
}