mirror of
https://github.com/viq/NewsBlur.git
synced 2025-11-11 00:41:01 +00:00
#1247 (Mac Catalyst edition)
This commit is contained in:
parent
b08e1f33d3
commit
7272ccf0d2
43 changed files with 270 additions and 158 deletions
|
|
@ -154,7 +154,7 @@
|
|||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSInteger activitiesCount = [appDelegate.userActivitiesArray count];
|
||||
int minimumHeight;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
minimumHeight = MINIMUM_ACTIVITY_HEIGHT_IPAD;
|
||||
} else {
|
||||
minimumHeight = MINIMUM_ACTIVITY_HEIGHT_IPHONE;
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
}
|
||||
|
||||
id activityCell;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
activityCell = [[ActivityCell alloc] init];
|
||||
} else {
|
||||
activityCell = [[SmallActivityCell alloc] init];
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
ActivityCell *cell = [tableView
|
||||
dequeueReusableCellWithIdentifier:@"ActivityCell"];
|
||||
if (cell == nil) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
cell = [[ActivityCell alloc]
|
||||
initWithStyle:UITableViewCellStyleDefault
|
||||
reuseIdentifier:@"ActivityCell"];
|
||||
|
|
@ -304,7 +304,7 @@
|
|||
UIImage *img = [UIImage imageNamed:@"fleuron.png"];
|
||||
UIImageView *fleuron = [[UIImageView alloc] initWithImage:img];
|
||||
int height;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
height = MINIMUM_ACTIVITY_HEIGHT_IPAD;
|
||||
} else {
|
||||
height = MINIMUM_ACTIVITY_HEIGHT_IPHONE;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
}
|
||||
|
||||
- (IBAction)doCancelButton {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[appDelegate hidePopover];
|
||||
} else {
|
||||
[appDelegate hidePopoverAnimated:YES];
|
||||
|
|
@ -272,7 +272,7 @@
|
|||
[self.errorLabel setText:[responseObject valueForKey:@"message"]];
|
||||
[self.errorLabel setHidden:NO];
|
||||
} else {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self->appDelegate hidePopover];
|
||||
} else {
|
||||
[self->appDelegate hidePopoverAnimated:YES];
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
[self.webView loadRequest:requestObj];
|
||||
}];
|
||||
|
||||
if (self.fromStory && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (self.fromStory && !appDelegate.isPhone) {
|
||||
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc]
|
||||
initWithTitle: @"Cancel"
|
||||
style: UIBarButtonItemStylePlain
|
||||
|
|
@ -75,6 +75,7 @@
|
|||
}
|
||||
|
||||
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
||||
BOOL isPhone = appDelegate.isPhone;
|
||||
NSURLRequest *request = navigationAction.request;
|
||||
NSString *URLString = [[request URL] absoluteString];
|
||||
NSLog(@"URL STRING IS %@", URLString);
|
||||
|
|
@ -86,7 +87,7 @@
|
|||
|
||||
if (self.fromStory) {
|
||||
[self.appDelegate refreshUserProfile:^{
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!isPhone) {
|
||||
[self.appDelegate.shareNavigationController viewWillAppear:YES];
|
||||
[self.appDelegate.modalNavigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import "MBProgressHUD.h"
|
||||
|
||||
@interface BaseViewController : UIViewController {
|
||||
}
|
||||
@interface BaseViewController : UIViewController
|
||||
|
||||
@property (nonatomic, readonly) BOOL isPhone;
|
||||
@property (nonatomic, readonly) BOOL isMac;
|
||||
@property (nonatomic, readonly) BOOL isVision;
|
||||
@property (nonatomic, readonly) BOOL isPortrait;
|
||||
@property (nonatomic, readonly) BOOL isCompactWidth;
|
||||
|
||||
- (void)informError:(id)error;
|
||||
- (void)informError:(id)error statusCode:(NSInteger)statusCode;
|
||||
|
|
|
|||
|
|
@ -177,4 +177,34 @@
|
|||
return UIStatusBarStyleLightContent;
|
||||
}
|
||||
|
||||
- (BOOL)isPhone {
|
||||
return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone;
|
||||
}
|
||||
|
||||
- (BOOL)isMac {
|
||||
return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomMac;
|
||||
}
|
||||
|
||||
- (BOOL)isVision {
|
||||
if (@available(iOS 17.0, *)) {
|
||||
return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomVision;
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isPortrait {
|
||||
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
|
||||
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
|
||||
return YES;
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isCompactWidth {
|
||||
return self.view.window.windowScene.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact;
|
||||
//return self.compactWidth > 0.0;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -185,20 +185,10 @@ class DetailViewController: BaseViewController {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if the device is an iPhone, otherwise `false`.
|
||||
@objc var isPhone: Bool {
|
||||
return UIDevice.current.userInterfaceIdiom == .phone
|
||||
}
|
||||
|
||||
/// Returns `true` if the window is in portrait orientation, otherwise `false`.
|
||||
@objc var isPortraitOrientation: Bool {
|
||||
return view.window?.windowScene?.interfaceOrientation.isPortrait ?? false
|
||||
}
|
||||
|
||||
/// Position of the divider between the views.
|
||||
var dividerPosition: CGFloat {
|
||||
get {
|
||||
let key = isPortraitOrientation ? Key.verticalPosition : Key.horizontalPosition
|
||||
let key = isPortrait ? Key.verticalPosition : Key.horizontalPosition
|
||||
let value = CGFloat(UserDefaults.standard.float(forKey: key))
|
||||
|
||||
if value == 0 {
|
||||
|
|
@ -212,7 +202,7 @@ class DetailViewController: BaseViewController {
|
|||
return
|
||||
}
|
||||
|
||||
let key = isPortraitOrientation ? Key.verticalPosition : Key.horizontalPosition
|
||||
let key = isPortrait ? Key.verticalPosition : Key.horizontalPosition
|
||||
|
||||
UserDefaults.standard.set(Float(newValue), forKey: key)
|
||||
}
|
||||
|
|
@ -453,6 +443,10 @@ private extension DetailViewController {
|
|||
func checkViewControllers() {
|
||||
let isTop = layout == .top
|
||||
|
||||
#if targetEnvironment(macCatalyst)
|
||||
// splitViewController?.primaryBackgroundStyle = .sidebar //TODO: work in progress
|
||||
#endif
|
||||
|
||||
if layout != .grid || isPhone {
|
||||
storyPagesViewController = listStoryPagesViewController
|
||||
_ = storyPagesViewController?.view
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
UIImage *folderImage = [UIImage imageNamed:@"folder-open"];
|
||||
CGFloat folderImageViewX = 10.0;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad) {
|
||||
if (((NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate]).isPhone) {
|
||||
folderImageViewX = 7.0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ struct FeedDetailGridView: View {
|
|||
}
|
||||
}
|
||||
.modify({ view in
|
||||
#if !targetEnvironment(macCatalyst)
|
||||
if #available(iOS 15.0, *) {
|
||||
view.refreshable {
|
||||
if cache.canPullToRefresh {
|
||||
|
|
@ -143,6 +144,7 @@ struct FeedDetailGridView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
})
|
||||
}
|
||||
.background(Color.themed([0xE0E0E0, 0xFFF8CA, 0x363636, 0x101010]))
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
@property (nonatomic) IBOutlet UIBarButtonItem * titleImageBarButton;
|
||||
@property (nonatomic, retain) NBNotifier *notifier;
|
||||
@property (nonatomic, retain) StoriesCollection *storiesCollection;
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
@property (nonatomic) UIRefreshControl *refreshControl;
|
||||
#endif
|
||||
@property (nonatomic) UISearchBar *searchBar;
|
||||
@property (nonatomic) IBOutlet UIView *messageView;
|
||||
@property (nonatomic) IBOutlet UILabel *messageLabel;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ typedef NS_ENUM(NSUInteger, FeedSection)
|
|||
if (@available(iOS 15.0, *)) {
|
||||
self.storyTitlesTable.allowsFocus = NO;
|
||||
}
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.storyTitlesTable.dragDelegate = self;
|
||||
self.storyTitlesTable.dragInteractionEnabled = YES;
|
||||
}
|
||||
|
|
@ -119,10 +119,12 @@ typedef NS_ENUM(NSUInteger, FeedSection)
|
|||
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
|
||||
spacer2BarButton.width = 0;
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
self.refreshControl = [UIRefreshControl new];
|
||||
self.refreshControl.tintColor = UIColorFromLightDarkRGB(0x0, 0xffffff);
|
||||
self.refreshControl.backgroundColor = UIColorFromRGB(0xE3E6E0);
|
||||
[self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
|
||||
#endif
|
||||
|
||||
self.searchBar = [[UISearchBar alloc]
|
||||
initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.storyTitlesTable.frame), 44.)];
|
||||
|
|
@ -434,7 +436,7 @@ typedef NS_ENUM(NSUInteger, FeedSection)
|
|||
if (storiesCollection == nil) {
|
||||
NSString *appOpening = [userPreferences stringForKey:@"app_opening"];
|
||||
|
||||
if ([appOpening isEqualToString:@"feeds"] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if ([appOpening isEqualToString:@"feeds"] && !self.isPhone) {
|
||||
self.messageLabel.text = @"Select a feed to read";
|
||||
self.messageView.hidden = NO;
|
||||
}
|
||||
|
|
@ -510,11 +512,13 @@ typedef NS_ENUM(NSUInteger, FeedSection)
|
|||
[self.searchBar setShowsCancelButton:NO animated:YES];
|
||||
}
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
if (self.canPullToRefresh) {
|
||||
self.storyTitlesTable.refreshControl = self.refreshControl;
|
||||
} else {
|
||||
self.storyTitlesTable.refreshControl = nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
[self updateTheme];
|
||||
|
||||
|
|
@ -1440,7 +1444,7 @@ typedef NS_ENUM(NSUInteger, FeedSection)
|
|||
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
|
||||
NSString *feedOpening = [preferences stringForKey:@"feed_opening"];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && feedOpening == nil) {
|
||||
if (!self.isPhone && feedOpening == nil) {
|
||||
feedOpening = @"story";
|
||||
}
|
||||
|
||||
|
|
@ -3068,8 +3072,10 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state
|
|||
self.navigationItem.titleView = [appDelegate makeFeedTitle:storiesCollection.activeFeed];
|
||||
}
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
self.refreshControl.tintColor = UIColorFromLightDarkRGB(0x0, 0xffffff);
|
||||
self.refreshControl.backgroundColor = UIColorFromRGB(0xE3E6E0);
|
||||
#endif
|
||||
|
||||
self.searchBar.backgroundColor = UIColorFromRGB(0xE3E6E0);
|
||||
self.searchBar.tintColor = UIColorFromRGB(0xffffff);
|
||||
|
|
@ -3165,6 +3171,7 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state
|
|||
return appDelegate.storiesCollection.activeFeed != nil && !river && !infrequent && !saved && !read && !widget;
|
||||
}
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
- (void)refresh:(UIRefreshControl *)refreshControl {
|
||||
if (self.canPullToRefresh) {
|
||||
self.inPullToRefresh_ = YES;
|
||||
|
|
@ -3173,10 +3180,13 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state
|
|||
[self finishRefresh];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)finishRefresh {
|
||||
self.inPullToRefresh_ = NO;
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
[self.refreshControl endRefreshing];
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
|
|
|||
|
|
@ -174,11 +174,18 @@ static UIFont *textFont = nil;
|
|||
BOOL isHighlighted = cell.highlighted || cell.selected;
|
||||
UIColor *backgroundColor;
|
||||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
backgroundColor = cell.isSocial ? UIColorFromRGB(0xD8E3DB) :
|
||||
cell.isSearch ? UIColorFromRGB(0xDBDFE6) :
|
||||
cell.isSaved ? UIColorFromRGB(0xDFDCD6) :
|
||||
UIColor.clearColor;
|
||||
#else
|
||||
backgroundColor = cell.isSocial ? UIColorFromRGB(0xD8E3DB) :
|
||||
cell.isSearch ? UIColorFromRGB(0xDBDFE6) :
|
||||
cell.isSaved ? UIColorFromRGB(0xDFDCD6) :
|
||||
UIColorFromRGB(0xF7F8F5);
|
||||
|
||||
#endif
|
||||
|
||||
// [backgroundColor set];
|
||||
self.backgroundColor = backgroundColor;
|
||||
cell.backgroundColor = backgroundColor;
|
||||
|
|
@ -219,7 +226,7 @@ static UIFont *textFont = nil;
|
|||
paragraphStyle.alignment = NSTextAlignmentLeft;
|
||||
CGSize faviconSize;
|
||||
if (cell.isSocial) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!cell.appDelegate.isPhone) {
|
||||
faviconSize = CGSizeMake(28, 28);
|
||||
UIImage *feedIcon = [Utilities roundCorneredImage:cell.feedFavicon radius:4 convertToSize:faviconSize];
|
||||
[feedIcon drawInRect:CGRectMake(9.0, CGRectGetMidY(r)-faviconSize.height/2, faviconSize.width, faviconSize.height)];
|
||||
|
|
@ -239,7 +246,7 @@ static UIFont *textFont = nil;
|
|||
} else {
|
||||
faviconSize = CGSizeMake(16, 16);
|
||||
UIImage *feedIcon = [Utilities roundCorneredImage:cell.feedFavicon radius:4 convertToSize:faviconSize];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!cell.appDelegate.isPhone) {
|
||||
[feedIcon drawInRect:CGRectMake(12.0, CGRectGetMidY(r)-faviconSize.height/2, faviconSize.width, faviconSize.height)];
|
||||
[cell.feedTitle drawInRect:CGRectMake(36.0, titleOffsetY, r.size.width - ([cell.unreadCount offsetWidth] + 36) - 10, font.pointSize*1.4)
|
||||
withAttributes:@{NSFontAttributeName: font,
|
||||
|
|
|
|||
|
|
@ -74,7 +74,9 @@ UIGestureRecognizerDelegate, UISearchBarDelegate> {
|
|||
@property (nonatomic, readwrite) BOOL viewShowingAllFeeds;
|
||||
@property (nonatomic, readwrite) BOOL interactiveFeedDetailTransition;
|
||||
@property (nonatomic, readwrite) BOOL isOffline;
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
@property (nonatomic) UIRefreshControl *refreshControl;
|
||||
#endif
|
||||
@property (nonatomic) UISearchBar *searchBar;
|
||||
@property (nonatomic, strong) NSArray<NSString *> *searchFeedIds;
|
||||
@property (nonatomic) NSCache *imageCache;
|
||||
|
|
|
|||
|
|
@ -113,12 +113,14 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
self.rowHeights = [NSMutableDictionary dictionary];
|
||||
self.folderTitleViews = [NSMutableDictionary dictionary];
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
self.refreshControl = [UIRefreshControl new];
|
||||
self.refreshControl.tintColor = UIColorFromLightDarkRGB(0x0, 0xffffff);
|
||||
self.refreshControl.backgroundColor = UIColorFromRGB(0xE3E6E0);
|
||||
[self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
|
||||
self.feedTitlesTable.refreshControl = self.refreshControl;
|
||||
self.feedViewToolbar.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
#endif
|
||||
|
||||
self.searchBar = [[UISearchBar alloc]
|
||||
initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.feedTitlesTable.frame), 44.)];
|
||||
|
|
@ -169,7 +171,13 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
[[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:
|
||||
UIColorFromFixedRGB(0x4C4D4A)}
|
||||
forState:UIControlStateHighlighted];
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// self.view.superview.backgroundColor = UIColor.clearColor;
|
||||
// self.view.backgroundColor = UIColor.clearColor;
|
||||
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); //TODO: work in progress
|
||||
#else
|
||||
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4);
|
||||
#endif
|
||||
self.navigationController.navigationBar.tintColor = UIColorFromRGB(0x8F918B);
|
||||
self.navigationController.navigationBar.translucent = NO;
|
||||
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
|
||||
|
|
@ -194,7 +202,12 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
self.notifier.topOffsetConstraint = [NSLayoutConstraint constraintWithItem:self.notifier attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.feedViewToolbar attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
|
||||
[self.view addConstraint:self.notifier.topOffsetConstraint];
|
||||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// self.feedTitlesTable.backgroundColor = UIColor.clearColor;
|
||||
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4); //TODO: work in progress
|
||||
#else
|
||||
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
|
||||
#endif
|
||||
self.feedTitlesTable.separatorColor = [UIColor clearColor];
|
||||
self.feedTitlesTable.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
self.feedTitlesTable.estimatedRowHeight = 0;
|
||||
|
|
@ -228,7 +241,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
[self resetRowHeights];
|
||||
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad &&
|
||||
// if (!self.isPhone &&
|
||||
// !self.interactiveFeedDetailTransition) {
|
||||
//
|
||||
// [appDelegate.masterContainerViewController transitionFromFeedDetail];
|
||||
|
|
@ -236,6 +249,13 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
// NSLog(@"Feed List timing 0: %f", [NSDate timeIntervalSinceReferenceDate] - start);
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
UINavigationController *navController = self.navigationController;
|
||||
UITitlebar *titlebar = navController.navigationBar.window.windowScene.titlebar;
|
||||
|
||||
titlebar.titleVisibility = UITitlebarTitleVisibilityHidden;
|
||||
#endif
|
||||
|
||||
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
|
||||
NSInteger intelligenceLevel = [userPreferences integerForKey:@"selectedIntelligence"];
|
||||
|
||||
|
|
@ -421,7 +441,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
- (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// CGSize toolbarSize = [self.feedViewToolbar sizeThatFits:self.view.frame.size];
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// self.feedViewToolbar.frame = CGRectMake(-10.0f,
|
||||
// CGRectGetHeight(self.view.frame) - toolbarSize.height,
|
||||
// toolbarSize.width + 20, toolbarSize.height);
|
||||
|
|
@ -430,7 +450,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
// }
|
||||
// self.innerView.frame = (CGRect){CGPointZero, CGSizeMake(CGRectGetWidth(self.view.frame), CGRectGetMinY(self.feedViewToolbar.frame))};
|
||||
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && !appDelegate.isCompactWidth) {
|
||||
// if (!self.isPhone && !appDelegate.isCompactWidth) {
|
||||
// CGRect navFrame = appDelegate.navigationController.view.frame;
|
||||
// CGFloat limit = appDelegate.masterContainerViewController.rightBorder.frame.origin.x + 1;
|
||||
//
|
||||
|
|
@ -452,7 +472,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
orientation = self.view.window.windowScene.interfaceOrientation;
|
||||
}
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && !UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
if (!self.isPhone && !UIInterfaceOrientationIsLandscape(orientation)) {
|
||||
[self.intelligenceControl setImage:[UIImage imageNamed:@"unread_yellow_icn.png"] forSegmentAtIndex:1];
|
||||
[self.intelligenceControl setImage:[Utilities imageNamed:@"indicator-focus" sized:14] forSegmentAtIndex:2];
|
||||
[self.intelligenceControl setImage:[Utilities imageNamed:@"unread_blue_icn.png" sized:14] forSegmentAtIndex:3];
|
||||
|
|
@ -490,6 +510,10 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark State Restoration
|
||||
|
||||
|
|
@ -897,7 +921,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
[self refreshHeaderCounts];
|
||||
[appDelegate checkForFeedNotifications];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && finished) {
|
||||
if (!self.isPhone && finished) {
|
||||
[self cacheFeedRowLocations];
|
||||
}
|
||||
|
||||
|
|
@ -1052,9 +1076,11 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
MenuViewController *viewController = [MenuViewController new];
|
||||
|
||||
[viewController addTitle:@"Preferences" iconName:@"dialog-preferences" iconColor:UIColorFromRGB(0xDF8566) selectionShouldDismiss:YES handler:^{
|
||||
[self.appDelegate showPreferences];
|
||||
}];
|
||||
if (!self.isMac) {
|
||||
[viewController addTitle:@"Preferences" iconName:@"dialog-preferences" iconColor:UIColorFromRGB(0xDF8566) selectionShouldDismiss:YES handler:^{
|
||||
[self.appDelegate showPreferences];
|
||||
}];
|
||||
}
|
||||
|
||||
[viewController addTitle:@"Mute Sites" iconName:@"menu_icn_mute.png" selectionShouldDismiss:YES handler:^{
|
||||
[self.appDelegate showMuteSites];
|
||||
|
|
@ -1295,9 +1321,15 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
self.feedViewToolbar.barTintColor = [UINavigationBar appearance].barTintColor;
|
||||
self.addBarButton.tintColor = UIColorFromRGB(0x8F918B);
|
||||
self.settingsBarButton.tintColor = UIColorFromRGB(0x8F918B);
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// self.view.superview.backgroundColor = UIColor.clearColor;
|
||||
// self.view.backgroundColor = UIColor.clearColor;
|
||||
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); //TODO: work in progress
|
||||
#else
|
||||
self.refreshControl.tintColor = UIColorFromLightDarkRGB(0x0, 0xffffff);
|
||||
self.refreshControl.backgroundColor = UIColorFromRGB(0xE3E6E0);
|
||||
self.view.backgroundColor = UIColorFromRGB(0xf4f4f4);
|
||||
#endif
|
||||
|
||||
[[ThemeManager themeManager] updateSegmentedControl:self.intelligenceControl];
|
||||
|
||||
|
|
@ -1322,7 +1354,13 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
self.searchBar.keyboardAppearance = UIKeyboardAppearanceDefault;
|
||||
}
|
||||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// self.feedTitlesTable.backgroundColor = UIColor.clearColor;
|
||||
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4); //TODO: work in progress
|
||||
#else
|
||||
self.feedTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
|
||||
#endif
|
||||
|
||||
[self reloadFeedTitlesTable];
|
||||
|
||||
[self resetupGestures];
|
||||
|
|
@ -1678,7 +1716,7 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
- (CGFloat)calculateHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (appDelegate.hasNoSites) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
return kBlurblogTableViewRowHeight;
|
||||
} else {
|
||||
return kPhoneBlurblogTableViewRowHeight;
|
||||
|
|
@ -1722,13 +1760,13 @@ static NSArray<NSString *> *NewsBlurTopSectionNames;
|
|||
|
||||
if ([folderName isEqualToString:@"river_blurblogs"] ||
|
||||
[folderName isEqualToString:@"river_global"]) { // blurblogs
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
height = kBlurblogTableViewRowHeight;
|
||||
} else {
|
||||
height = kPhoneBlurblogTableViewRowHeight;
|
||||
}
|
||||
} else {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
height = kTableViewRowHeight;
|
||||
} else {
|
||||
height = kPhoneTableViewRowHeight;
|
||||
|
|
@ -2448,7 +2486,7 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
[hud hide:YES afterDelay:0.5];
|
||||
[self showExplainerOnEmptyFeedlist];
|
||||
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// FeedDetailViewController *storiesModule = self.appDelegate.dashboardViewController.storiesModule;
|
||||
//
|
||||
// storiesModule.storiesCollection.feedPage = 0;
|
||||
|
|
@ -2677,15 +2715,19 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
#pragma mark -
|
||||
#pragma mark PullToRefresh
|
||||
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
- (void)refresh:(UIRefreshControl *)refreshControl {
|
||||
self.inPullToRefresh_ = YES;
|
||||
[appDelegate reloadFeedsView:NO];
|
||||
[appDelegate donateRefresh];
|
||||
}
|
||||
#endif
|
||||
|
||||
- (void)finishRefresh {
|
||||
self.inPullToRefresh_ = NO;
|
||||
#if !TARGET_OS_MACCATALYST
|
||||
[self.refreshControl endRefreshing];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)refreshFeedList {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@
|
|||
|
||||
if (section == NewsBlurTopSectionInfrequentSiteStories) {
|
||||
folderImage = [UIImage imageNamed:@"ak-icon-infrequent.png"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
allowLongPress = YES;
|
||||
} else if (section == NewsBlurTopSectionAllStories) {
|
||||
folderImage = [UIImage imageNamed:@"all-stories"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
|
|
@ -229,42 +229,42 @@
|
|||
allowLongPress = NO;
|
||||
} else if ([folderName isEqual:@"river_global"]) {
|
||||
folderImage = [UIImage imageNamed:@"global-shares"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 8;
|
||||
}
|
||||
} else if ([folderName isEqual:@"river_blurblogs"]) {
|
||||
folderImage = [UIImage imageNamed:@"all-shares"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 8;
|
||||
}
|
||||
} else if ([folderName isEqual:@"saved_searches"]) {
|
||||
folderImage = [UIImage imageNamed:@"search"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
}
|
||||
} else if ([folderName isEqual:@"saved_stories"]) {
|
||||
folderImage = [UIImage imageNamed:@"saved-stories"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
}
|
||||
} else if ([folderName isEqual:@"read_stories"]) {
|
||||
folderImage = [UIImage imageNamed:@"indicator-unread"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
}
|
||||
} else if ([folderName isEqual:@"widget_stories"]) {
|
||||
folderImage = [UIImage imageNamed:@"g_icn_folder_widget.png"];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
folderImageViewX = 10;
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
|
|
@ -275,7 +275,7 @@
|
|||
} else {
|
||||
folderImage = [UIImage imageNamed:@"folder-open"];
|
||||
}
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
} else {
|
||||
folderImageViewX = 7;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
// if (self.inSearch_){
|
||||
// return 0;
|
||||
// } else {
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
|
||||
// if (!self.isPhone){
|
||||
// return 28;
|
||||
// }else{
|
||||
// return 21;
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
viewForHeaderInSection:(NSInteger)section {
|
||||
int headerLabelHeight, folderImageViewY;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
headerLabelHeight = 28;
|
||||
folderImageViewY = 3;
|
||||
} else {
|
||||
|
|
@ -280,7 +280,7 @@ viewForHeaderInSection:(NSInteger)section {
|
|||
|
||||
// add a NO FRIENDS TO SUGGEST message on either the first or second row depending on iphone/ipad
|
||||
int row = 0;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
row = 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
NSInteger userInteractions = [appDelegate.userInteractionsArray count];
|
||||
int minimumHeight;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
minimumHeight = MINIMUM_INTERACTION_HEIGHT_IPAD;
|
||||
} else {
|
||||
minimumHeight = MINIMUM_INTERACTION_HEIGHT_IPHONE;
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
}
|
||||
|
||||
InteractionCell *interactionCell;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
interactionCell = [[InteractionCell alloc] init];
|
||||
} else {
|
||||
interactionCell = [[SmallInteractionCell alloc] init];
|
||||
|
|
@ -190,7 +190,7 @@
|
|||
InteractionCell *cell = [tableView
|
||||
dequeueReusableCellWithIdentifier:@"InteractionCell"];
|
||||
if (cell == nil) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
cell = [[InteractionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"InteractionCell"];
|
||||
} else {
|
||||
cell = [[SmallInteractionCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"InteractionCell"];
|
||||
|
|
@ -276,7 +276,7 @@
|
|||
UIImageView *fleuron = [[UIImageView alloc] initWithImage:img];
|
||||
|
||||
int height;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
height = MINIMUM_INTERACTION_HEIGHT_IPAD;
|
||||
} else {
|
||||
height = MINIMUM_INTERACTION_HEIGHT_IPHONE;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
}
|
||||
|
||||
- (void)rearrangeViews {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
CGSize viewSize = self.view.bounds.size;
|
||||
CGFloat viewWidth = viewSize.width;
|
||||
CGFloat yOffset = 0;
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// }
|
||||
// return NO;
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self updateControls];
|
||||
[self rearrangeViews];
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
self.errorLabel.hidden = !hasError;
|
||||
self.forgotPasswordButton.hidden = !hasError;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.loginOptionalLabel.hidden = hasError;
|
||||
}
|
||||
}
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
[textField resignFirstResponder];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
if(textField == usernameInput) {
|
||||
[passwordInput becomeFirstResponder];
|
||||
} else if (textField == passwordInput) {
|
||||
|
|
@ -244,7 +244,7 @@
|
|||
setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
|
||||
|
||||
NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[params setObject:[signUpUsernameInput text] forKey:@"username"];
|
||||
[params setObject:[signUpPasswordInput text] forKey:@"password"];
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// // Return YES for supported orientations
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// return YES;
|
||||
// } else if (UIInterfaceOrientationIsPortrait(interfaceOrientation)) {
|
||||
// return YES;
|
||||
|
|
|
|||
|
|
@ -287,7 +287,6 @@ SFSafariViewControllerDelegate> {
|
|||
@property (nonatomic, readwrite) BOOL hasQueuedReadStories;
|
||||
@property (nonatomic, readwrite) BOOL hasQueuedSavedStories;
|
||||
@property (nonatomic, readonly) BOOL showingSafariViewController;
|
||||
@property (nonatomic, readonly) BOOL isCompactWidth;
|
||||
//@property (nonatomic) CGFloat compactWidth;
|
||||
|
||||
@property (nonatomic, strong) BGAppRefreshTask *backgroundAppRefreshTask;
|
||||
|
|
@ -395,7 +394,6 @@ SFSafariViewControllerDelegate> {
|
|||
- (BOOL)isSavedStoriesIntelligenceMode;
|
||||
- (NSArray *)allFeedIds;
|
||||
- (NSArray *)feedIdsForFolderTitle:(NSString *)folderTitle;
|
||||
- (BOOL)isPortrait;
|
||||
- (void)confirmLogout;
|
||||
- (void)showConnectToService:(NSString *)serviceName;
|
||||
- (void)showAlert:(UIAlertController *)alert withViewController:(UIViewController *)vc;
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@
|
|||
// self.navigationController.viewControllers = [NSArray arrayWithObject:self.feedsViewController];
|
||||
self.storiesCollection = [StoriesCollection new];
|
||||
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhond) {
|
||||
// self.window.rootViewController = self.masterContainerViewController;
|
||||
// } else {
|
||||
// self.window.rootViewController = self.navigationController;
|
||||
|
|
@ -242,7 +242,7 @@
|
|||
(unsigned long)NULL), ^(void) {
|
||||
[self setupReachability];
|
||||
self.cacheImagesOperationQueue = [NSOperationQueue new];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.cacheImagesOperationQueue.maxConcurrentOperationCount = 2;
|
||||
} else {
|
||||
self.cacheImagesOperationQueue.maxConcurrentOperationCount = 1;
|
||||
|
|
@ -423,6 +423,10 @@
|
|||
return handled;
|
||||
}
|
||||
|
||||
- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder {
|
||||
|
||||
}
|
||||
|
||||
- (void)delayedAddSite {
|
||||
[self.feedsViewController tapAddSite:self];
|
||||
}
|
||||
|
|
@ -476,7 +480,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
NSString *name = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? @"Root~ipad.plist" : @"Root.plist";
|
||||
NSString *name = !self.isPhone ? @"Root~ipad.plist" : @"Root.plist";
|
||||
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:name]];
|
||||
NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
|
||||
|
||||
|
|
@ -767,7 +771,7 @@
|
|||
newUserProfile.navigationItem.title = self.activeUserProfileName;
|
||||
newUserProfile.navigationItem.backBarButtonItem.title = self.activeUserProfileName;
|
||||
[newUserProfile getUserProfile];
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self showPopoverWithViewController:self.userProfileNavigationController contentSize:CGSizeMake(320, 454) sender:sender];
|
||||
} else {
|
||||
[self.feedsNavigationController presentViewController:navController animated:YES completion:nil];
|
||||
|
|
@ -799,7 +803,7 @@
|
|||
}
|
||||
|
||||
- (void)hideUserProfileModal {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self hidePopover];
|
||||
} else {
|
||||
[self.feedsNavigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
|
|
@ -896,6 +900,11 @@
|
|||
}
|
||||
|
||||
- (void)showPreferences {
|
||||
if (self.isMac) {
|
||||
// [[UIApplication sharedApplication] sendAction:@selector(orderFrontPreferencesPanel:) to:nil from:nil forEvent:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preferencesViewController) {
|
||||
preferencesViewController = [[IASKAppSettingsViewController alloc] init];
|
||||
[[ThemeManager themeManager] addThemeGestureRecognizerToView:self.preferencesViewController.view];
|
||||
|
|
@ -917,7 +926,7 @@
|
|||
self.modalNavigationController = navController;
|
||||
self.modalNavigationController.navigationBar.translucent = NO;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.modalNavigationController.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
}
|
||||
|
||||
|
|
@ -1092,7 +1101,7 @@
|
|||
}
|
||||
}];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
BOOL fromPopover = [self hidePopoverAnimated:NO];
|
||||
[self.splitViewController presentViewController:activityViewController animated:!fromPopover completion:nil];
|
||||
activityViewController.modalPresentationStyle = UIModalPresentationPopover;
|
||||
|
|
@ -1132,7 +1141,7 @@
|
|||
setReplyId:(NSString *)replyId {
|
||||
|
||||
[self.shareViewController setCommentType:type];
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [self.masterContainerViewController transitionToShareView];
|
||||
// [self.shareViewController setSiteInfo:type setUserId:userId setUsername:username setReplyId:replyId];
|
||||
// } else {
|
||||
|
|
@ -1154,7 +1163,7 @@
|
|||
self.shareViewController.currentType = nil;
|
||||
}
|
||||
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [self.masterContainerViewController transitionFromShareView];
|
||||
// [self.storyPagesViewController becomeFirstResponder];
|
||||
// } else
|
||||
|
|
@ -1301,7 +1310,7 @@
|
|||
trainerViewController.storyTrainer = NO;
|
||||
trainerViewController.feedLoaded = feedLoaded;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
// trainerViewController.modalPresentationStyle=UIModalPresentationFormSheet;
|
||||
// [navController presentViewController:trainerViewController animated:YES completion:nil];
|
||||
[self showPopoverWithViewController:self.trainerViewController contentSize:CGSizeMake(500, 630) sender:sender];
|
||||
|
|
@ -1320,7 +1329,7 @@
|
|||
trainerViewController.feedTrainer = NO;
|
||||
trainerViewController.storyTrainer = YES;
|
||||
trainerViewController.feedLoaded = YES;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self showPopoverWithViewController:self.trainerViewController contentSize:CGSizeMake(500, 630) sender:sender];
|
||||
} else {
|
||||
if (self.trainNavigationController == nil) {
|
||||
|
|
@ -1343,7 +1352,7 @@
|
|||
- (void)openNotificationsWithFeed:(NSString *)feedId sender:(id)sender {
|
||||
UINavigationController *navController = self.feedsNavigationController;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self showPopoverWithViewController:self.notificationsViewController contentSize:CGSizeMake(420, 382) sender:sender];
|
||||
} else {
|
||||
if (self.notificationsNavigationController == nil) {
|
||||
|
|
@ -1453,13 +1462,17 @@
|
|||
networkManager.responseSerializer = [AFJSONResponseSerializer serializer];
|
||||
[networkManager.requestSerializer setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData];
|
||||
|
||||
NSString *currentiPhoneVersion = [[[NSBundle mainBundle] infoDictionary]
|
||||
NSString *currentVersion = [[[NSBundle mainBundle] infoDictionary]
|
||||
objectForKey:@"CFBundleVersion"];
|
||||
NSString *UA;
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
UA = [NSString stringWithFormat:@"NewsBlur iPad App v%@", currentiPhoneVersion];
|
||||
if (self.isMac) {
|
||||
UA = [NSString stringWithFormat:@"NewsBlur Mac App v%@", currentVersion];
|
||||
} else if (self.isVision) {
|
||||
UA = [NSString stringWithFormat:@"NewsBlur Vision App v%@", currentVersion];
|
||||
} else if (self.isPhone) {
|
||||
UA = [NSString stringWithFormat:@"NewsBlur iPhone App v%@", currentVersion];
|
||||
} else {
|
||||
UA = [NSString stringWithFormat:@"NewsBlur iPhone App v%@", currentiPhoneVersion];
|
||||
UA = [NSString stringWithFormat:@"NewsBlur iPad App v%@", currentVersion];
|
||||
}
|
||||
[networkManager.requestSerializer setValue:UA forHTTPHeaderField:@"User-Agent"];
|
||||
}
|
||||
|
|
@ -1699,7 +1712,7 @@
|
|||
[self reloadFeedsView:NO];
|
||||
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [self loadFeedDetailView];
|
||||
// } else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
// // [self.feedsNavigationController popToRootViewControllerAnimated:NO];
|
||||
|
|
@ -1747,7 +1760,7 @@
|
|||
storiesCollection.activeFeed = feed;
|
||||
storiesCollection.activeFolder = nil;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self loadFeedDetailView];
|
||||
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
// [self.feedsNavigationController popToRootViewControllerAnimated:NO];
|
||||
|
|
@ -1768,7 +1781,7 @@
|
|||
- (void)backgroundLoadNotificationStory {
|
||||
if (self.inFindingStoryMode) {
|
||||
if ([storiesCollection.activeFolder isEqualToString:@"widget_stories"]) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self.feedsViewController selectWidgetStories];
|
||||
} else {
|
||||
[self loadRiverFeedDetailView:self.feedDetailViewController withFolder:self.widgetFolder];
|
||||
|
|
@ -1781,7 +1794,7 @@
|
|||
}
|
||||
} else if (self.tryFeedFeedId && !self.isTryFeedView) {
|
||||
[self loadFeed:self.tryFeedFeedId withStory:self.tryFeedStoryId animated:NO];
|
||||
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && !self.isCompactWidth && self.storiesCollection == nil) {
|
||||
} else if (!self.isPhone && !self.isCompactWidth && self.storiesCollection == nil) {
|
||||
[self loadRiverFeedDetailView:self.feedDetailViewController withFolder:storiesCollection.activeFolder];
|
||||
} else if (self.pendingFolder != nil) {
|
||||
[self loadRiverFeedDetailView:self.feedDetailViewController withFolder:self.pendingFolder];
|
||||
|
|
@ -1821,7 +1834,7 @@
|
|||
[self loadRiverFeedDetailView:feedDetailViewController withFolder:@"saved_stories"];
|
||||
|
||||
if (showHUD) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self.storyPagesViewController showShareHUD:@"Finding story..."];
|
||||
} else {
|
||||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.feedDetailViewController.view animated:YES];
|
||||
|
|
@ -1888,20 +1901,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (BOOL)isPortrait {
|
||||
UIInterfaceOrientation orientation = self.window.windowScene.interfaceOrientation;
|
||||
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown) {
|
||||
return YES;
|
||||
} else {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)isCompactWidth {
|
||||
return self.window.windowScene.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassCompact;
|
||||
//return self.compactWidth > 0.0;
|
||||
}
|
||||
|
||||
- (void)confirmLogout {
|
||||
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Positive?" message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alertController addAction:[UIAlertAction actionWithTitle: @"Logout" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
||||
|
|
@ -2112,7 +2111,7 @@
|
|||
[self loadRiverFeedDetailView:feedDetailViewController withFolder:@"river_dashboard"];
|
||||
|
||||
if (showHUD) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self.storyPagesViewController showShareHUD:@"Finding story..."];
|
||||
} else {
|
||||
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.feedDetailViewController.view animated:YES];
|
||||
|
|
@ -2225,7 +2224,7 @@
|
|||
[self.detailViewController checkLayout];
|
||||
}
|
||||
|
||||
BOOL animated = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad &&
|
||||
BOOL animated = (!self.isPhone &&
|
||||
!self.tryFeedCategory);
|
||||
[self.storyPagesViewController view];
|
||||
[self.storyPagesViewController.view setNeedsLayout];
|
||||
|
|
@ -2353,7 +2352,7 @@
|
|||
self.activeOriginalStoryURL = url;
|
||||
originalStoryViewController.customPageTitle = customTitle;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
if ([sender isKindOfClass:[UIBarButtonItem class]]) {
|
||||
[originalStoryViewController view]; // Force viewDidLoad
|
||||
[originalStoryViewController loadInitialStory];
|
||||
|
|
@ -2408,7 +2407,7 @@
|
|||
}
|
||||
|
||||
- (void)deferredSafariCleanup {
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// self.navigationController.view.frame = CGRectMake(self.navigationController.view.frame.origin.x, self.navigationController.view.frame.origin.y, self.isPortrait ? 270.0 : 370.0, self.navigationController.view.frame.size.height);
|
||||
// }
|
||||
|
||||
|
|
@ -2442,7 +2441,7 @@
|
|||
}
|
||||
|
||||
- (void)closeOriginalStory {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
// [self.masterContainerViewController transitionFromOriginalView];
|
||||
} else {
|
||||
if ([[feedsNavigationController viewControllers] containsObject:originalStoryViewController]) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@
|
|||
viewForHeaderInSection:(NSInteger)section {
|
||||
int headerLabelHeight, folderImageViewY;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
headerLabelHeight = 36;
|
||||
folderImageViewY = 8;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
self.view.layer.shadowOpacity = 0.5;
|
||||
self.view.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.view.bounds].CGPath;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
closeButton = [UIBarButtonItem barItemWithImage:[UIImage imageNamed:@"ios7_back_button"]
|
||||
target:self
|
||||
action:@selector(closeOriginalView)];
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
// UIGestureRecognizer *themeGesture = [[ThemeManager themeManager] addThemeGestureRecognizerToView:self.webView];
|
||||
// [self.webView.scrollView.panGestureRecognizer requireGestureRecognizerToFail:themeGesture];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
UIPanGestureRecognizer *gesture = [[UIPanGestureRecognizer alloc]
|
||||
initWithTarget:self action:@selector(handlePanGesture:)];
|
||||
gesture.delegate = self;
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
center.y);
|
||||
self.view.center = center;
|
||||
[recognizer setTranslation:CGPointZero inView:self.view];
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [appDelegate.masterContainerViewController interactiveTransitionFromOriginalView:percentage];
|
||||
// } else {
|
||||
//
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
[self transitionToFeedDetail:recognizer];
|
||||
} else {
|
||||
// NSLog(@"Original velocity: %f (at %.2f%%)", velocity, percentage*100);
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [appDelegate.masterContainerViewController transitionToOriginalView:NO];
|
||||
// } else {
|
||||
//
|
||||
|
|
@ -241,7 +241,7 @@
|
|||
}
|
||||
|
||||
- (void)transitionToFeedDetail:(UIGestureRecognizer *)recognizer {
|
||||
// if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
// if (!self.isPhone) {
|
||||
// [appDelegate.masterContainerViewController transitionFromOriginalView];
|
||||
// } else {
|
||||
//
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@
|
|||
self.storyTitle.frame = CGRectMake(20, 8, v.width - 20*2, 24);
|
||||
stOffset = self.storyTitle.frame.origin.y + self.storyTitle.frame.size.height;
|
||||
stHeight = self.storyTitle.frame.size.height;
|
||||
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
} else if (!self.isPhone) {
|
||||
k = 0;
|
||||
}
|
||||
NSLog(@"Share type: %@", self.currentType);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#import "SmallActivityCell.h"
|
||||
#import "UIImageView+AFNetworking.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import "NewsBlurAppDelegate.h"
|
||||
|
||||
@implementation SmallActivityCell
|
||||
|
||||
|
|
@ -62,7 +63,7 @@
|
|||
labelFrame.size.height = contentRect.size.height;
|
||||
self.activityLabel.frame = labelFrame;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!((NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate]).isPhone) {
|
||||
self.activityLabel.backgroundColor = UIColorFromRGB(0xd7dadf);
|
||||
} else {
|
||||
self.activityLabel.backgroundColor = UIColorFromRGB(0xf6f6f6);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#import "SmallInteractionCell.h"
|
||||
#import "UIImageView+AFNetworking.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import "NewsBlurAppDelegate.h"
|
||||
|
||||
@implementation SmallInteractionCell
|
||||
|
||||
|
|
@ -57,8 +58,8 @@
|
|||
labelFrame.size.width = contentRect.size.width - leftMargin - avatarSize - leftMargin - rightMargin - 20;
|
||||
labelFrame.size.height = contentRect.size.height;
|
||||
self.interactionLabel.frame = labelFrame;
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
|
||||
if (!((NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate]).isPhone) {
|
||||
self.interactionLabel.backgroundColor = UIColorFromRGB(0xd7dadf);
|
||||
} else {
|
||||
self.interactionLabel.backgroundColor = UIColorFromRGB(0xf6f6f6);
|
||||
|
|
|
|||
|
|
@ -335,14 +335,14 @@ class StorySettings {
|
|||
guard let pref = UserDefaults.standard.string(forKey: "grid_columns"), let columns = Int(pref) else {
|
||||
if NewsBlurAppDelegate.shared.isCompactWidth {
|
||||
return 1
|
||||
} else if NewsBlurAppDelegate.shared.isPortrait() {
|
||||
} else if NewsBlurAppDelegate.shared.isPortrait {
|
||||
return 2
|
||||
} else {
|
||||
return 4
|
||||
}
|
||||
}
|
||||
|
||||
if NewsBlurAppDelegate.shared.isPortrait(), columns > 3 {
|
||||
if NewsBlurAppDelegate.shared.isPortrait, columns > 3 {
|
||||
return 3
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
#import "JNWThrottledBlock.h"
|
||||
#import "NewsBlur-Swift.h"
|
||||
|
||||
#define iPadPro12 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && ([UIScreen mainScreen].bounds.size.height == 1366 || [UIScreen mainScreen].bounds.size.width == 1366))
|
||||
#define iPadPro10 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && ([UIScreen mainScreen].bounds.size.height == 1112 || [UIScreen mainScreen].bounds.size.width == 1112))
|
||||
#define iPadPro12 (!self.isPhone && ([UIScreen mainScreen].bounds.size.height == 1366 || [UIScreen mainScreen].bounds.size.width == 1366))
|
||||
#define iPadPro10 (!self.isPhone && ([UIScreen mainScreen].bounds.size.height == 1112 || [UIScreen mainScreen].bounds.size.width == 1112))
|
||||
|
||||
@interface StoryDetailObjCViewController ()
|
||||
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
[self.webView.scrollView setAutoresizingMask:(UIViewAutoresizingFlexibleWidth |
|
||||
UIViewAutoresizingFlexibleHeight)];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.webView.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
|
||||
|
|
@ -401,9 +401,13 @@
|
|||
static NSURL *baseURL;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
#if TARGET_OS_MACCATALYST
|
||||
baseURL = [NSBundle mainBundle].resourceURL;
|
||||
#else
|
||||
baseURL = [NSBundle mainBundle].bundleURL;
|
||||
#endif
|
||||
});
|
||||
|
||||
|
||||
[self.webView loadHTMLString:html baseURL:baseURL];
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +484,7 @@
|
|||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// CATALYST: probably will want to add custom CSS for Macs.
|
||||
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide NB-width-768";
|
||||
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide";
|
||||
#else
|
||||
if (UIInterfaceOrientationIsLandscape(orientation) && !self.isPhoneOrCompact) {
|
||||
if (iPadPro12) {
|
||||
|
|
@ -503,10 +507,10 @@
|
|||
} else {
|
||||
contentWidthClass = @"NB-iphone";
|
||||
}
|
||||
#endif
|
||||
|
||||
contentWidthClass = [NSString stringWithFormat:@"%@ NB-width-%d",
|
||||
contentWidthClass, (int)floorf(CGRectGetWidth(self.view.frame))];
|
||||
#endif
|
||||
|
||||
if (appDelegate.feedsViewController.isOffline) {
|
||||
NSString *storyHash = [self.activeStory objectForKey:@"story_hash"];
|
||||
|
|
@ -2399,7 +2403,7 @@
|
|||
|
||||
#if TARGET_OS_MACCATALYST
|
||||
// CATALYST: probably will want to add custom CSS for Macs.
|
||||
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide NB-width-768";
|
||||
contentWidthClass = @"NB-ipad-wide NB-ipad-pro-12-wide";
|
||||
#else
|
||||
UIInterfaceOrientation orientation = self.view.window.windowScene.interfaceOrientation;
|
||||
|
||||
|
|
@ -2424,10 +2428,10 @@
|
|||
} else {
|
||||
contentWidthClass = @"NB-iphone";
|
||||
}
|
||||
#endif
|
||||
|
||||
contentWidthClass = [NSString stringWithFormat:@"%@ NB-width-%d",
|
||||
contentWidthClass, (int)floorf(CGRectGetWidth(webView.scrollView.bounds))];
|
||||
#endif
|
||||
|
||||
NSString *alternateViewClass = @"";
|
||||
if (!self.isPhoneOrCompact) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
[self.scrollView setAlwaysBounceHorizontal:self.isHorizontal];
|
||||
[self.scrollView setAlwaysBounceVertical:!self.isHorizontal];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
|
||||
|
|
@ -663,7 +663,7 @@
|
|||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||
[self hideNotifier];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[currentPage realignScroll];
|
||||
}
|
||||
}
|
||||
|
|
@ -772,7 +772,7 @@
|
|||
|
||||
if (pageIndex >= 0) {
|
||||
[self changePage:pageIndex animated:NO];
|
||||
} else if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
} else if (!self.isPhone) {
|
||||
// If the story can't be found, don't show anything; uncomment this to instead show the first unread story:
|
||||
// [self doNextUnreadStory:nil];
|
||||
} else {
|
||||
|
|
@ -1218,7 +1218,7 @@
|
|||
|
||||
[appDelegate.storiesCollection pushReadStory:[appDelegate.activeStory objectForKey:@"story_hash"]];
|
||||
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
if (appDelegate.detailViewController.storyTitlesOnLeft) {
|
||||
appDelegate.detailViewController.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
|
||||
originalStoryButton,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@
|
|||
[self informError:@"Could not load trainer"];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC),
|
||||
dispatch_get_main_queue(), ^() {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!self.isPhone) {
|
||||
[self.appDelegate hidePopover];
|
||||
} else {
|
||||
[self.appDelegate.feedsNavigationController dismissViewControllerAnimated:YES completion:nil];
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ const int COUNT_HEIGHT = 18;
|
|||
CGRect rr;
|
||||
|
||||
if (listType == NBFeedListSocial) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
rr = CGRectMake(rect.size.width + rect.origin.x - psOffset, CGRectGetMidY(r)-COUNT_HEIGHT/2, psWidth, COUNT_HEIGHT);
|
||||
} else {
|
||||
rr = CGRectMake(rect.size.width + rect.origin.x - psOffset, CGRectGetMidY(r)-COUNT_HEIGHT/2, psWidth, COUNT_HEIGHT);
|
||||
|
|
@ -98,7 +98,7 @@ const int COUNT_HEIGHT = 18;
|
|||
if (nt > 0 && appDelegate.selectedIntelligence <= 0) {
|
||||
CGRect rr;
|
||||
if (listType == NBFeedListSocial) {
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
||||
if (!appDelegate.isPhone) {
|
||||
rr = CGRectMake(rect.size.width + rect.origin.x - psWidth - psPadding - ntOffset, CGRectGetMidY(r)-COUNT_HEIGHT/2, ntWidth, COUNT_HEIGHT);
|
||||
} else {
|
||||
rr = CGRectMake(rect.size.width + rect.origin.x - psWidth - psPadding - ntOffset, CGRectGetMidY(r)-COUNT_HEIGHT/2, ntWidth, COUNT_HEIGHT);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 52;
|
||||
objectVersion = 54;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
|
|
@ -5539,7 +5539,9 @@
|
|||
PROVISIONING_PROFILE = "";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
|
||||
SWIFT_OBJC_INTERFACE_HEADER_NAME = "NewsBlur-Swift.h";
|
||||
TARGETED_DEVICE_FAMILY = "1,2,6";
|
||||
|
|
@ -5586,7 +5588,9 @@
|
|||
PRODUCT_NAME = "NB Alpha";
|
||||
PROVISIONING_PROFILE = "";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = YES;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Other Sources/BridgingHeader.h";
|
||||
SWIFT_OBJC_INTERFACE_HEADER_NAME = "NewsBlur-Swift.h";
|
||||
TARGETED_DEVICE_FAMILY = "1,2,6";
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
|
|||
|
||||
#pragma mark -
|
||||
|
||||
static NSArray * AFHTTPRequestSerializerObservedKeyPaths() {
|
||||
static NSArray * AFHTTPRequestSerializerObservedKeyPaths(void) {
|
||||
static NSArray *_AFHTTPRequestSerializerObservedKeyPaths = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
|
@ -591,7 +591,7 @@ forHTTPHeaderField:(NSString *)field
|
|||
|
||||
#pragma mark -
|
||||
|
||||
static NSString * AFCreateMultipartFormBoundary() {
|
||||
static NSString * AFCreateMultipartFormBoundary(void) {
|
||||
return [NSString stringWithFormat:@"Boundary+%08X%08X", arc4random(), arc4random()];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0
|
||||
#endif
|
||||
|
||||
static dispatch_queue_t url_session_manager_creation_queue() {
|
||||
static dispatch_queue_t url_session_manager_creation_queue(void) {
|
||||
static dispatch_queue_t af_url_session_manager_creation_queue;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
|
@ -49,7 +49,7 @@ static void url_session_manager_create_task_safely(dispatch_block_t block) {
|
|||
}
|
||||
}
|
||||
|
||||
static dispatch_queue_t url_session_manager_processing_queue() {
|
||||
static dispatch_queue_t url_session_manager_processing_queue(void) {
|
||||
static dispatch_queue_t af_url_session_manager_processing_queue;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
|
@ -59,7 +59,7 @@ static dispatch_queue_t url_session_manager_processing_queue() {
|
|||
return af_url_session_manager_processing_queue;
|
||||
}
|
||||
|
||||
static dispatch_group_t url_session_manager_completion_group() {
|
||||
static dispatch_group_t url_session_manager_completion_group(void) {
|
||||
static dispatch_group_t af_url_session_manager_completion_group;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#import "UIRefreshControl+AFNetworking.h"
|
||||
#import <objc/runtime.h>
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
|
||||
|
||||
#import "AFURLSessionManager.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ CGRect IASKCGRectSwap(CGRect rect);
|
|||
- (BOOL)isPad {
|
||||
BOOL isPad = NO;
|
||||
#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)
|
||||
isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
|
||||
isPad = [[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhone;
|
||||
#endif
|
||||
return isPad;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@
|
|||
switch (interfaceIdiom) {
|
||||
case UIUserInterfaceIdiomPad: return @"~ipad";
|
||||
case UIUserInterfaceIdiomPhone: return @"~iphone";
|
||||
default: return @"~iphone";
|
||||
default: return @"~ipad";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ static NSString *const AppExtensionWebViewPageDetails = @"pageDetails";
|
|||
}
|
||||
|
||||
- (UIActivityViewController *)activityViewControllerForItem:(nonnull NSDictionary *)item viewController:(nonnull UIViewController*)viewController sender:(nullable id)sender typeIdentifier:(nonnull NSString *)typeIdentifier {
|
||||
NSAssert(NO == ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && sender == nil), @"sender must not be nil on iPad.");
|
||||
NSAssert(NO == ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhone && sender == nil), @"sender must not be nil on iPad.");
|
||||
|
||||
NSItemProvider *itemProvider = [[NSItemProvider alloc] initWithItem:item typeIdentifier:typeIdentifier];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6pv-7g-17r">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6pv-7g-17r" initialMenu="YWi-Ju-M3z">
|
||||
<device id="ipad11_0rounded" orientation="landscape" layout="fullscreen" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="UIMenu" message="Requires Xcode 11 or later." minToolsVersion="11.0" requiredIntegratedClassName="UICommandDiff"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
<objects>
|
||||
<viewController storyboardIdentifier="DetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="djW-7k-haK" customClass="DetailViewController" customModule="NewsBlur" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jTZ-4O-xyT">
|
||||
<rect key="frame" x="0.0" y="0.0" width="818.5" height="834"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||
<subviews>
|
||||
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bPa-u1-Aml">
|
||||
<rect key="frame" x="0.0" y="74" width="1194" height="580"/>
|
||||
|
|
@ -110,7 +111,7 @@
|
|||
<objects>
|
||||
<viewController storyboardIdentifier="FeedsViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="c70-P4-4n6" customClass="FeedsViewController" customModule="NewsBlur" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="B68-yP-FpJ">
|
||||
<rect key="frame" x="0.0" y="0.0" width="420" height="834"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hRx-bd-6Da">
|
||||
|
|
@ -239,12 +240,23 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="180.90452261306532" y="285.61151079136692"/>
|
||||
</scene>
|
||||
<!--Root-->
|
||||
<scene sceneID="eNE-X1-NXV">
|
||||
<objects>
|
||||
<menu isSystemItem="YES" title="Root" identifier="com.apple.menu.root" id="YWi-Ju-M3z" sceneMemberID="viewController">
|
||||
<systemMenuChildDeletions>
|
||||
<menuDeletion anchor="com.apple.menu.format"/>
|
||||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="J28-e1-gcC" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1484" y="632"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="gvC-iq-nYU">
|
||||
<objects>
|
||||
<navigationController storyboardIdentifier="FeedsNavigationController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="TEt-aw-KDr" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="FYM-Eb-jEE">
|
||||
<rect key="frame" x="0.0" y="24" width="420" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
|
|
@ -276,7 +288,6 @@
|
|||
<objects>
|
||||
<navigationController storyboardIdentifier="FeedDetailNavigationController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="u8Q-0B-JY9" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Sc3-NO-Rlz">
|
||||
<rect key="frame" x="0.0" y="24" width="375" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
|
|
@ -292,7 +303,6 @@
|
|||
<objects>
|
||||
<navigationController storyboardIdentifier="DetailNavigationController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="HsP-cn-nIY" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="Noh-2M-34G">
|
||||
<rect key="frame" x="0.0" y="24" width="818.5" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
|
|
@ -336,7 +346,7 @@
|
|||
<objects>
|
||||
<viewController storyboardIdentifier="FeedDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="gfj-2g-i9p" customClass="FeedDetailViewController" customModule="NewsBlur" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Qlc-Qa-4j4">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="760"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="FeedDetailTable" showsHorizontalScrollIndicator="NO" bouncesZoom="NO" dataMode="prototypes" style="plain" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="HYy-Wb-YEm">
|
||||
|
|
@ -405,7 +415,7 @@
|
|||
<objects>
|
||||
<viewController id="afA-W0-XsQ" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="jBw-7b-YGl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="580"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<viewLayoutGuide key="safeArea" id="xqp-qa-ugn"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
|
|
@ -420,7 +430,7 @@
|
|||
<objects>
|
||||
<viewController id="1tQ-fy-A3c" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="jdW-Cp-Pkg">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="168"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1194" height="834"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<viewLayoutGuide key="safeArea" id="k4r-Od-mPr"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue