mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1306 (status bar during fullscreen)
- Now uses an opaque color instead of a nice gradient behind the status bar.
This commit is contained in:
parent
e718b4ead6
commit
c2296df955
2 changed files with 15 additions and 7 deletions
|
@ -74,7 +74,7 @@
|
|||
@property (nonatomic) IBOutlet UIImageView *dragBarImageView;
|
||||
@property (nonatomic) IBOutlet NSLayoutConstraint *traverseBottomConstraint;
|
||||
@property (nonatomic) IBOutlet NSLayoutConstraint *scrollBottomConstraint;
|
||||
@property (nonatomic) IBOutlet UIView *statusBarGradientView;
|
||||
@property (nonatomic) IBOutlet UIView *statusBarBackgroundView;
|
||||
@property (nonatomic) BOOL autoscrollAvailable;
|
||||
@property (nonatomic) BOOL autoscrollActive;
|
||||
@property (nonatomic) NSTimeInterval autoscrollSpeed;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
@interface StoryPageControl ()
|
||||
|
||||
@property (nonatomic) CGFloat statusBarHeight;
|
||||
@property (nonatomic, strong) NSTimer *autoscrollTimer;
|
||||
@property (nonatomic, strong) NSTimer *autoscrollViewTimer;
|
||||
@property (nonatomic, strong) NSString *restoringStoryId;
|
||||
|
@ -118,6 +119,12 @@
|
|||
[self.scrollView sizeToFit];
|
||||
// NSLog(@"Scroll view frame post 2: %@", NSStringFromCGRect(self.scrollView.frame));
|
||||
|
||||
if (@available(iOS 13.0, *)) {
|
||||
self.statusBarHeight = appDelegate.window.windowScene.statusBarManager.statusBarFrame.size.height;
|
||||
} else {
|
||||
self.statusBarHeight = [UIApplication sharedApplication].statusBarFrame.size.height;
|
||||
}
|
||||
|
||||
// adding HUD for progress bar
|
||||
CGFloat radius = 8;
|
||||
circularProgressView = [[THCircularProgressView alloc]
|
||||
|
@ -459,7 +466,7 @@
|
|||
BOOL shouldHideStatusBar = [preferences boolForKey:@"story_hide_status_bar"];
|
||||
BOOL isNavBarHidden = self.navigationController.navigationBarHidden;
|
||||
|
||||
self.statusBarGradientView.hidden = shouldHideStatusBar || !isNavBarHidden || !appDelegate.isPortrait;
|
||||
self.statusBarBackgroundView.hidden = shouldHideStatusBar || !isNavBarHidden || !appDelegate.isPortrait;
|
||||
}
|
||||
|
||||
- (BOOL)prefersStatusBarHidden {
|
||||
|
@ -1579,14 +1586,15 @@
|
|||
|
||||
- (void)updateStatusBarTheme {
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||
[self.statusBarGradientView removeFromSuperview];
|
||||
[self.statusBarBackgroundView removeFromSuperview];
|
||||
|
||||
CGRect statusRect = CGRectMake(0, 0, self.view.bounds.size.width, 70);
|
||||
CGRect statusRect = CGRectMake(0, 0, self.view.bounds.size.width, self.statusBarHeight);
|
||||
|
||||
self.statusBarGradientView = [NewsBlurAppDelegate makeSimpleGradientView:statusRect startColor:UIColorFromRGB(0xffffff) endColor:[UIColorFromRGB(0xffffff) colorWithAlphaComponent:0.0]];
|
||||
self.statusBarBackgroundView = [[UIView alloc] initWithFrame:statusRect];
|
||||
self.statusBarBackgroundView.backgroundColor = self.navigationController.navigationBar.barTintColor;
|
||||
|
||||
[self.view addSubview:self.statusBarGradientView];
|
||||
self.statusBarGradientView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
|
||||
[self.view addSubview:self.statusBarBackgroundView];
|
||||
self.statusBarBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
|
||||
|
||||
[self updateStatusBarState];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue