mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
parent
9f314033a5
commit
a0b628409e
21 changed files with 80 additions and 98 deletions
|
@ -318,7 +318,7 @@
|
|||
cell.textLabel.text = @"Loading...";
|
||||
|
||||
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
UIImage *spacer = [UIImage imageNamed:@"spacer"];
|
||||
UIGraphicsBeginImageContext(spinner.frame.size);
|
||||
[spacer drawInRect:CGRectMake(0, 0, spinner.frame.size.width,spinner.frame.size.height)];
|
||||
|
|
|
@ -328,7 +328,7 @@
|
|||
[self.storyTitlesTable reloadData];
|
||||
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self setUserAvatarLayout:orientation];
|
||||
[self.notifier setNeedsLayout];
|
||||
} completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
|
@ -342,7 +342,7 @@
|
|||
|
||||
self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate];
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self setUserAvatarLayout:orientation];
|
||||
self.finishedAnimatingIn = NO;
|
||||
[MBProgressHUD hideHUDForView:self.view animated:NO];
|
||||
|
@ -500,7 +500,7 @@
|
|||
|
||||
[self.searchBar resignFirstResponder];
|
||||
[self.appDelegate hidePopoverAnimated:YES];
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
if (self.isMovingToParentViewController) {
|
||||
appDelegate.inFindingStoryMode = NO;
|
||||
|
@ -1387,7 +1387,7 @@
|
|||
UIImage *img = [UIImage imageNamed:@"fleuron.png"];
|
||||
UIImageView *fleuron = [[UIImageView alloc] initWithImage:img];
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (!self.isPhoneOrCompact
|
||||
&& !appDelegate.masterContainerViewController.storyTitlesOnLeft
|
||||
&& UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
|
@ -1599,7 +1599,7 @@
|
|||
cell.textSize = self.textSize;
|
||||
cell.isShort = NO;
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (!self.isPhoneOrCompact &&
|
||||
!appDelegate.masterContainerViewController.storyTitlesOnLeft &&
|
||||
UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
|
@ -1834,7 +1834,7 @@ heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|||
}
|
||||
|
||||
- (BOOL)isShortTitles {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
return !self.isPhoneOrCompact &&
|
||||
!appDelegate.masterContainerViewController.storyTitlesOnLeft &&
|
||||
|
|
|
@ -166,7 +166,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4);
|
||||
self.navigationController.navigationBar.tintColor = UIColorFromRGB(0x8F918B);
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self layoutForInterfaceOrientation:orientation];
|
||||
|
||||
UILongPressGestureRecognizer *longpress = [[UILongPressGestureRecognizer alloc]
|
||||
|
@ -387,7 +387,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
|
||||
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self layoutForInterfaceOrientation:orientation];
|
||||
[self.notifier setNeedsLayout];
|
||||
} completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
|
@ -425,7 +425,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
- (void)updateIntelligenceControlForOrientation:(UIInterfaceOrientation)orientation {
|
||||
if (orientation == UIInterfaceOrientationUnknown) {
|
||||
orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
}
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && !UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
|
@ -2254,7 +2254,7 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
|
||||
- (void)layoutHeaderCounts:(UIInterfaceOrientation)orientation {
|
||||
if (!orientation) {
|
||||
orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
}
|
||||
|
||||
BOOL isShort = NO;
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
|
||||
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
activityView.frame = CGRectMake(68, 7, 20, 20.0);
|
||||
self.activityIndicator = activityView;
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@
|
|||
allowLongPress = NO;
|
||||
} else if ([folderName isEqual:@"saved_searches"]) {
|
||||
folderImage = [UIImage imageNamed:@"g_icn_search.png"];
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
|
|
|
@ -270,7 +270,7 @@
|
|||
#pragma mark - Table view data source
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
return 13;
|
||||
} else {
|
||||
return 12;
|
||||
|
@ -281,7 +281,7 @@
|
|||
static NSString *CellIndentifier = @"Cell";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIndentifier];
|
||||
NSUInteger iPadOffset = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? 0 : 1;
|
||||
NSUInteger iPadOffset = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ? 0 : 1;
|
||||
|
||||
if (indexPath.row == 7) {
|
||||
return [self makeFontSizeTableCell];
|
||||
|
@ -396,7 +396,7 @@
|
|||
}
|
||||
|
||||
|
||||
// if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (indexPath.row != 2 && indexPath.row != 3) {
|
||||
// // if we're opening another popover, then don't animate out - it looks strange
|
||||
// [self.appDelegate.masterContainerViewController hidePopover];
|
||||
|
|
|
@ -290,7 +290,7 @@
|
|||
cell.textLabel.text = @"Loading...";
|
||||
|
||||
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
UIImage *spacer = [UIImage imageNamed:@"spacer"];
|
||||
UIGraphicsBeginImageContext(spinner.frame.size);
|
||||
[spacer drawInRect:CGRectMake(0, 0, spinner.frame.size.width,spinner.frame.size.height)];
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
CGFloat yOffset = 0;
|
||||
CGFloat xOffset = isOnSignUpScreen ? -viewWidth : 0;
|
||||
|
||||
if (UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])) {
|
||||
if (UIInterfaceOrientationIsPortrait(self.appDelegate.window.windowScene.interfaceOrientation)) {
|
||||
yOffset = viewSize.height / 6;
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@
|
|||
}
|
||||
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
// leftBorder.frame = CGRectMake(0, 0, 1, CGRectGetHeight(self.view.bounds));
|
||||
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
|
@ -293,7 +293,7 @@
|
|||
return self.appDelegate.compactWidth;
|
||||
}
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
return NB_DEFAULT_MASTER_WIDTH_LANDSCAPE;
|
||||
}
|
||||
|
@ -452,7 +452,7 @@
|
|||
CGRect vb = [self.view bounds];
|
||||
rightBorder.frame = CGRectMake(self.masterWidth-1, 0, 1, CGRectGetHeight(self.view.bounds));
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
// add the back button
|
||||
self.storyPageControl.navigationItem.leftBarButtonItem = self.storyPageControl.buttonBack;
|
||||
|
@ -625,7 +625,7 @@
|
|||
}
|
||||
|
||||
CGRect vb = [self.view bounds];
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
// Force the story page control to load.
|
||||
[storyPageControl view];
|
||||
|
@ -726,7 +726,7 @@
|
|||
}
|
||||
|
||||
- (void)transitionToOriginalView:(BOOL)resetLayout {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
CGRect vb = [self.view bounds];
|
||||
|
||||
self.originalViewIsVisible = YES;
|
||||
|
@ -806,7 +806,7 @@
|
|||
|
||||
- (void)interactiveTransitionFromOriginalView:(CGFloat)percentage {
|
||||
CGRect vb = [self.view bounds];
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
// CGRect originalNavFrame = self.originalNavigationController.view.frame;
|
||||
|
@ -882,7 +882,7 @@
|
|||
[self.view insertSubview:self.dashboardViewController.view atIndex:0];
|
||||
[self.view addSubview:self.masterNavigationController.view];
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
// CASE: story titles on bottom
|
||||
if (resetLayout) {
|
||||
|
@ -984,7 +984,7 @@
|
|||
self.isHidingStory = YES; // the flag allows the keyboard animation to also slide down the share view
|
||||
[self.shareViewController.commentField resignFirstResponder];
|
||||
} else {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
|
||||
self.storyNavigationController.view.frame = CGRectMake(self.storyNavigationController.view.frame.origin.x,
|
||||
0,
|
||||
|
@ -1098,7 +1098,7 @@
|
|||
NSDictionary *userInfo = notification.userInfo;
|
||||
NSTimeInterval duration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];
|
||||
UIViewAnimationCurve curve = [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue];
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
CGRect vb = [self.view bounds];
|
||||
CGRect keyboardFrame = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||
CGRect storyNavigationFrame = self.storyNavigationController.view.frame;
|
||||
|
|
|
@ -188,7 +188,7 @@
|
|||
self.progressBar.hidden = YES;
|
||||
|
||||
if (style == NBLoadingStyle) {
|
||||
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
[activityIndicator startAnimating];
|
||||
self.accessoryView = activityIndicator;
|
||||
} else if (style == NBOfflineStyle) {
|
||||
|
@ -203,7 +203,7 @@
|
|||
self.accessoryView = imageView;
|
||||
self.progressBar.hidden = NO;
|
||||
} else if (style == NBSyncingStyle) {
|
||||
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
[activityIndicator startAnimating];
|
||||
self.accessoryView = activityIndicator;
|
||||
} else if (style == NBDoneStyle) {
|
||||
|
|
|
@ -1168,7 +1168,7 @@
|
|||
[self.masterContainerViewController presentViewController:self.ftuxNavigationController animated:YES completion:nil];
|
||||
|
||||
self.ftuxNavigationController.view.superview.frame = CGRectMake(0, 0, 540, 540);//it's important to do this after
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.window.windowScene.interfaceOrientation;
|
||||
if (UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
self.ftuxNavigationController.view.superview.center = self.view.center;
|
||||
} else {
|
||||
|
@ -1739,7 +1739,7 @@
|
|||
}
|
||||
|
||||
- (BOOL)isPortrait {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.window.windowScene.interfaceOrientation;
|
||||
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
|
||||
return YES;
|
||||
} else {
|
||||
|
|
|
@ -324,12 +324,12 @@
|
|||
activeUrl = [[webView URL] absoluteString];
|
||||
finishedLoading = NO;
|
||||
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
|
||||
[MBProgressHUD hideHUDForView:self.webView animated:YES];
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
[self updateTitle:self.webView];
|
||||
finishedLoading = YES;
|
||||
[self resetProgressBar];
|
||||
|
@ -337,7 +337,7 @@
|
|||
|
||||
- (void)webView:(WKWebView *)webView didFailLoadWithError:(NSError *)error
|
||||
{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
|
||||
// if (error.code == 102 && [error.domain isEqual:@"WebKitErrorDomain"]) { }
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@
|
|||
[self.contentView addSubview:self.followButton];
|
||||
|
||||
// ACTIVITY INDICATOR
|
||||
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium];
|
||||
activityView.frame = CGRectMake(40, 98, 20, 20.0);
|
||||
self.activityIndicator = activityView;
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
name:@"TapAndHoldNotification"
|
||||
object:nil];
|
||||
|
||||
_orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
_orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
}
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
|
||||
|
@ -315,8 +315,8 @@
|
|||
[appDelegate.feedDetailViewController.view endEditing:YES];
|
||||
}
|
||||
|
||||
if (_orientation != [UIApplication sharedApplication].statusBarOrientation) {
|
||||
_orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
if (_orientation != self.appDelegate.window.windowScene.interfaceOrientation) {
|
||||
_orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
NSLog(@"Found stale orientation in story detail: %@", NSStringFromCGSize(self.view.bounds.size));
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@
|
|||
// self.webView.scrollView.contentSize.height);
|
||||
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
self->_orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
self->_orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self changeWebViewWidth];
|
||||
[self drawFeedGradient];
|
||||
[self scrollToLastPosition:NO];
|
||||
|
@ -354,7 +354,7 @@
|
|||
}
|
||||
|
||||
- (void)viewWillLayoutSubviews {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[super viewWillLayoutSubviews];
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self.appDelegate.storyPageControl layoutForInterfaceOrientation:orientation];
|
||||
|
@ -409,7 +409,7 @@
|
|||
}
|
||||
|
||||
- (void)drawStory {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self drawStory:NO withOrientation:orientation];
|
||||
}
|
||||
|
||||
|
@ -1329,7 +1329,7 @@
|
|||
BOOL isHorizontal = appDelegate.storyPageControl.isHorizontal;
|
||||
BOOL isNavBarHidden = appDelegate.storyPageControl.isNavigationBarHidden;
|
||||
|
||||
if (self.webView.scrollView.contentOffset.y < (-1 * self.feedTitleGradient.frame.size.height + 1 + self.webView.scrollView.scrollIndicatorInsets.top)) {
|
||||
if (self.webView.scrollView.contentOffset.y < (-1 * self.feedTitleGradient.frame.size.height + 1 + self.webView.scrollView.verticalScrollIndicatorInsets.top)) {
|
||||
// Pulling
|
||||
if (!pullingScrollview) {
|
||||
pullingScrollview = YES;
|
||||
|
@ -2385,7 +2385,7 @@
|
|||
// NSLog(@"changeWebViewWidth: %@ / %@ / %@", NSStringFromCGSize(self.view.bounds.size), NSStringFromCGSize(webView.scrollView.bounds.size), NSStringFromCGSize(webView.scrollView.contentSize));
|
||||
|
||||
NSInteger contentWidth = CGRectGetWidth(webView.scrollView.bounds);
|
||||
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
UIInterfaceOrientation orientation = self.appDelegate.window.windowScene.interfaceOrientation;
|
||||
NSString *contentWidthClass;
|
||||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
|
|
|
@ -119,11 +119,7 @@
|
|||
[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;
|
||||
}
|
||||
self.statusBarHeight = appDelegate.window.windowScene.statusBarManager.statusBarFrame.size.height;
|
||||
|
||||
// adding HUD for progress bar
|
||||
CGFloat radius = 8;
|
||||
|
@ -241,7 +237,7 @@
|
|||
options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld
|
||||
context:nil];
|
||||
|
||||
_orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
_orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
[self addKeyCommandWithInput:UIKeyInputDownArrow modifierFlags:0 action:@selector(changeToNextPage:) discoverabilityTitle:@"Next Story"];
|
||||
[self addKeyCommandWithInput:@"j" modifierFlags:0 action:@selector(changeToNextPage:) discoverabilityTitle:@"Next Story"];
|
||||
|
@ -364,7 +360,7 @@
|
|||
style:UIBarButtonItemStylePlain
|
||||
target:nil action:nil];
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self layoutForInterfaceOrientation:orientation];
|
||||
[self adjustDragBar:orientation];
|
||||
[self reorientPages];
|
||||
|
@ -437,8 +433,8 @@
|
|||
|
||||
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) {
|
||||
// NSLog(@"---> Story page control is re-orienting: %@ / %@", NSStringFromCGSize(self.scrollView.bounds.size), NSStringFromCGSize(size));
|
||||
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
self->_orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
self->_orientation = orientation;
|
||||
[self layoutForInterfaceOrientation:orientation];
|
||||
[self adjustDragBar:orientation];
|
||||
[self reorientPages];
|
||||
|
@ -479,7 +475,7 @@
|
|||
self.scrollViewTopConstraint.constant = 0;
|
||||
}
|
||||
|
||||
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
|
||||
UIInterfaceOrientation orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
[self layoutForInterfaceOrientation:orientation];
|
||||
[self adjustDragBar:orientation];
|
||||
}
|
||||
|
@ -507,7 +503,7 @@
|
|||
}
|
||||
|
||||
- (BOOL)allowFullscreen {
|
||||
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone || self.presentedViewController != nil) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhone || self.presentedViewController != nil) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -784,7 +780,7 @@
|
|||
}
|
||||
|
||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
if (!self.isPhoneOrCompact &&
|
||||
UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
|
@ -804,7 +800,7 @@
|
|||
}
|
||||
|
||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = appDelegate.window.windowScene.interfaceOrientation;
|
||||
|
||||
if (!self.isPhoneOrCompact &&
|
||||
UIInterfaceOrientationIsPortrait(orientation)) {
|
||||
|
@ -1621,7 +1617,7 @@
|
|||
}
|
||||
|
||||
- (void)updateStatusBarTheme {
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
[self.statusBarBackgroundView removeFromSuperview];
|
||||
|
||||
CGRect statusRect = CGRectMake(0, 0, self.view.bounds.size.width, self.statusBarHeight);
|
||||
|
|
|
@ -86,15 +86,15 @@
|
|||
}];
|
||||
}
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
});
|
||||
// dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
// });
|
||||
dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
|
||||
NSLog(@"Queue finished: %ld total (%ld remaining)", (long)appDelegate.totalUncachedImagesCount, (long)appDelegate.remainingUncachedImagesCount);
|
||||
[self updateProgress];
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
});
|
||||
// dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
// });
|
||||
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// [appDelegate.feedsViewController hideNotifier];
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
if ([hashes count] == 0) {
|
||||
// NSLog(@"Finished downloading unread stories. %d total", appDelegate.totalUnfetchedStoryCount);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"offline_text_download"]) {
|
||||
[self.appDelegate.feedsViewController showCachingNotifier:@"Text" progress:0 hoursBack:1];
|
||||
|
@ -86,9 +86,9 @@
|
|||
[lock signal];
|
||||
}];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
});
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
// });
|
||||
|
||||
[lock waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:30]];
|
||||
[lock unlock];
|
||||
|
|
|
@ -97,17 +97,17 @@
|
|||
}];
|
||||
}
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
});
|
||||
// dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
|
||||
// });
|
||||
dispatch_group_wait(group, DISPATCH_TIME_FOREVER);
|
||||
NSLog(@"Queue finished: %ld total (%ld remaining)", (long)self.appDelegate.totalUncachedTextCount, (long)self.appDelegate.remainingUncachedTextCount);
|
||||
|
||||
[self updateProgress];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
});
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
// });
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
|
|
@ -3657,7 +3657,6 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "Share Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -3669,7 +3668,6 @@
|
|||
PROVISIONING_PROFILE = "";
|
||||
SKIP_INSTALL = YES;
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -3704,7 +3702,6 @@
|
|||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
INFOPLIST_FILE = "Share Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -3716,7 +3713,6 @@
|
|||
PROVISIONING_PROFILE = "";
|
||||
SKIP_INSTALL = YES;
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
|
@ -3754,7 +3750,6 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Widget Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -3768,8 +3763,6 @@
|
|||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -3800,7 +3793,6 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Widget Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -3812,8 +3804,6 @@
|
|||
PRODUCT_NAME = "NewsBlur Latest";
|
||||
SKIP_INSTALL = YES;
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
|
@ -3842,7 +3832,6 @@
|
|||
GCC_VERSION = "";
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = "NewsBlur-iPhone-Info.plist";
|
||||
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -3862,8 +3851,6 @@
|
|||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
"WARNING_CFLAGS[arch=*]" = "-Wall";
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -3891,7 +3878,6 @@
|
|||
GCC_VERSION = "";
|
||||
HEADER_SEARCH_PATHS = "";
|
||||
INFOPLIST_FILE = "NewsBlur-iPhone-Info.plist";
|
||||
"IPHONEOS_DEPLOYMENT_TARGET[sdk=macosx*]" = 13.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
@ -3909,8 +3895,6 @@
|
|||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
|
@ -3953,7 +3937,8 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/**";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MARKETING_VERSION = 11.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
|
@ -3962,6 +3947,8 @@
|
|||
SDKROOT = iphoneos;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -4002,7 +3989,8 @@
|
|||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/**";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||
MARKETING_VERSION = 11.0;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
|
@ -4011,6 +3999,8 @@
|
|||
SDKROOT = iphoneos;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
@ -4042,7 +4032,6 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Story Notification Service Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -4054,7 +4043,6 @@
|
|||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SKIP_INSTALL = YES;
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -4080,7 +4068,6 @@
|
|||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = "Story Notification Service Extension/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -4092,7 +4079,6 @@
|
|||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SKIP_INSTALL = YES;
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
@ -117,7 +117,7 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
|
|||
if (self.networkActivityActionBlock) {
|
||||
self.networkActivityActionBlock(networkActivityIndicatorVisible);
|
||||
} else {
|
||||
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible];
|
||||
// [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -487,7 +487,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
|||
// Update to indeterminate indicator
|
||||
[indicator removeFromSuperview];
|
||||
self.indicator = MB_AUTORELEASE([[UIActivityIndicatorView alloc]
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]);
|
||||
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge]);
|
||||
[(UIActivityIndicatorView *)indicator startAnimating];
|
||||
[self addSubview:indicator];
|
||||
}
|
||||
|
@ -749,7 +749,7 @@ static const CGFloat kDetailsLabelFontSize = 12.f;
|
|||
[self setNeedsDisplay];
|
||||
}
|
||||
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
|
||||
UIInterfaceOrientation orientation = [UIApplication sharedApplication].delegate.window.windowScene.interfaceOrientation;
|
||||
CGFloat radians = 0;
|
||||
if (UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
if (orientation == UIInterfaceOrientationLandscapeLeft) { radians = -(CGFloat)M_PI_2; }
|
||||
|
|
Loading…
Add table
Reference in a new issue