Massive refactor to fix all toolbar buttons so they extend to the edge.

This commit is contained in:
Samuel Clay 2013-10-11 17:46:09 -07:00
parent 0bed4be790
commit 402c5d9fc1
20 changed files with 119 additions and 137 deletions

View file

@ -12,7 +12,6 @@
#import "BaseViewController.h"
#import "Utilities.h"
#import "WEPopoverController.h"
#import "TransparentToolbar.h"
#import "NBNotifier.h"
#import "MCSwipeTableViewCell.h"
@ -48,10 +47,8 @@
@property (nonatomic) IBOutlet UIBarButtonItem * settingsBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * spacerBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * spacer2BarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * spacer3BarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * separatorBarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * titleImageBarButton;
@property (nonatomic) IBOutlet TransparentToolbar * rightToolbar;
@property (nonatomic, retain) WEPopoverController *popoverController;
@property (nonatomic, retain) NBNotifier *notifier;

View file

@ -24,7 +24,6 @@
#import "UIBarButtonItem+WEPopover.h"
#import "WEPopoverController.h"
#import "UIBarButtonItem+Image.h"
#import "TransparentToolbar.h"
#import "FeedDetailMenuViewController.h"
#import "NBNotifier.h"
#import "NBLoadingCell.h"
@ -51,8 +50,7 @@
@synthesize settingsBarButton;
@synthesize separatorBarButton;
@synthesize titleImageBarButton;
@synthesize spacerBarButton, spacer2BarButton, spacer3BarButton;
@synthesize rightToolbar;
@synthesize spacerBarButton, spacer2BarButton;
@synthesize appDelegate;
@synthesize feedPage;
@synthesize pageFetching;
@ -77,19 +75,12 @@
self.storyTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4);
self.storyTitlesTable.separatorColor = UIColorFromRGB(0xE9E8E4);
rightToolbar = [[TransparentToolbar alloc]
initWithFrame:CGRectMake(0, 0, 76, 44)];
rightToolbar.keepSpacing = YES;
spacerBarButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
spacerBarButton.width = -10;
spacerBarButton.width = 0;
spacer2BarButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
spacer2BarButton.width = -10;
spacer3BarButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
spacer3BarButton.width = -6;
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
spacer2BarButton.width = 0;
UIImage *separatorImage = [UIImage imageNamed:@"bar-separator.png"];
separatorBarButton = [UIBarButtonItem barItemWithImage:separatorImage target:nil action:nil];
@ -97,7 +88,7 @@
UIImage *settingsImage = [UIImage imageNamed:@"nav_icn_settings.png"];
settingsBarButton = [UIBarButtonItem barItemWithImage:settingsImage target:self action:@selector(doOpenSettingsActionSheet:)];
UIImage *markreadImage = [UIImage imageNamed:@"markread.png"];
feedMarkReadButton = [UIBarButtonItem barItemWithImage:markreadImage target:self action:@selector(doOpenMarkReadActionSheet:)];
@ -131,42 +122,49 @@
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
[self setUserAvatarLayout:orientation];
self.finishedAnimatingIn = NO;
[MBProgressHUD hideHUDForView:self.view animated:YES];
[MBProgressHUD hideHUDForView:self.view animated:NO];
// set right avatar title image
spacerBarButton.width = 0;
spacer2BarButton.width = 0;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
spacerBarButton.width = -6;
spacer2BarButton.width = 10;
}
if (appDelegate.isSocialView) {
spacerBarButton.width = -6;
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"id"]];
UIImage *titleImage = [Utilities getImage:feedIdStr isSocial:YES];
titleImage = [Utilities roundCorneredImage:titleImage radius:6];
[((UIButton *)titleImageBarButton.customView).imageView removeFromSuperview];
titleImageBarButton = [UIBarButtonItem barItemWithImage:titleImage
target:self
action:@selector(showUserProfile)];
titleImageBarButton.customView.frame = CGRectMake(0, 0, 32, 32);
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
spacerBarButton,
titleImageBarButton,
spacer2BarButton,
separatorBarButton,
feedMarkReadButton, nil];
} else {
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
spacerBarButton,
settingsBarButton,
spacer2BarButton,
separatorBarButton,
feedMarkReadButton,
nil];
}
// set center title
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
UILabel *titleLabel = (UILabel *)[appDelegate makeFeedTitle:appDelegate.activeFeed];
self.navigationItem.titleView = titleLabel;
}
// set right avatar title image
if (appDelegate.isSocialView) {
NBBarButtonItem *titleImageButton = [appDelegate makeRightFeedTitle:appDelegate.activeFeed];
[titleImageButton addTarget:self action:@selector(showUserProfile) forControlEvents:UIControlEventTouchUpInside];
titleImageBarButton.customView = titleImageButton;
[rightToolbar setItems: [NSArray arrayWithObjects:
spacerBarButton,
feedMarkReadButton,
spacer2BarButton,
separatorBarButton,
spacer3BarButton,
titleImageBarButton, nil]];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightToolbar];
titleImageBarButton.enabled = YES;
} else {
[rightToolbar setItems: [NSArray arrayWithObjects:
spacerBarButton,
feedMarkReadButton,
spacer2BarButton,
separatorBarButton,
spacer3BarButton,
settingsBarButton, nil]];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightToolbar];
}
NSMutableArray *indexPaths = [NSMutableArray array];
NSLog(@"appDelegate.recentlyReadStoryLocations: %d - %@", self.isOffline, appDelegate.recentlyReadStoryLocations);
// NSLog(@"appDelegate.recentlyReadStoryLocations: %d - %@", self.isOffline, appDelegate.recentlyReadStoryLocations);
for (id i in appDelegate.recentlyReadStoryLocations) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[i intValue]
inSection:0];
@ -185,8 +183,6 @@
appDelegate.recentlyReadStoryLocations = [NSMutableArray array];
appDelegate.originalStoryCount = [appDelegate unreadCount];
[super viewWillAppear:animated];
if ((appDelegate.isSocialRiverView ||
appDelegate.isSocialView ||
[appDelegate.activeFolder isEqualToString:@"saved_stories"])) {
@ -220,7 +216,6 @@
[super viewDidAppear:animated];
if (appDelegate.inStoryDetail && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
appDelegate.inStoryDetail = NO;
[appDelegate.storyPageControl resetPages];
[self checkScroll];
}
@ -1463,7 +1458,7 @@
- (void)showUserProfile {
appDelegate.activeUserProfileId = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"user_id"]];
appDelegate.activeUserProfileName = [NSString stringWithFormat:@"%@", [appDelegate.activeFeed objectForKey:@"username"]];
[appDelegate showUserProfileModal:self.navigationItem.rightBarButtonItem];
[appDelegate showUserProfileModal:titleImageBarButton];
}
- (void)changeActiveFeedDetailRow {

View file

@ -86,16 +86,16 @@
CGContextSetStrokeColor(context, CGColorGetComponents([topColor CGColor]));
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0.5f);
CGContextAddLineToPoint(context, rect.size.width, 0.5f);
CGContextMoveToPoint(context, 0, 0.25f);
CGContextAddLineToPoint(context, rect.size.width, 0.25f);
CGContextStrokePath(context);
// bottom border
UIColor *bottomColor = UIColorFromRGB(0xB7BBAA);
CGContextSetStrokeColor(context, CGColorGetComponents([bottomColor CGColor]));
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, rect.size.height - .5f);
CGContextAddLineToPoint(context, rect.size.width, rect.size.height - .5f);
CGContextMoveToPoint(context, 0, rect.size.height-0.25f);
CGContextAddLineToPoint(context, rect.size.width, rect.size.height-0.25f);
CGContextStrokePath(context);
// Folder title

View file

@ -48,7 +48,12 @@
self.emailInput.borderStyle = UITextBorderStyleRoundedRect;
self.signUpPasswordInput.borderStyle = UITextBorderStyleRoundedRect;
self.signUpUsernameInput.borderStyle = UITextBorderStyleRoundedRect;
[self.loginControl
setTitleTextAttributes:@{NSFontAttributeName:
[UIFont fontWithName:@"Helvetica-Bold" size:11.0f]}
forState:UIControlStateNormal];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
self.logInView.frame = CGRectMake(134, 180, 500, 300);
@ -218,6 +223,7 @@
[self.passwordInput setText:@""];
[self.signUpPasswordInput setText:@""];
[appDelegate reloadFeedsView:YES];
[self dismissViewControllerAnimated:YES completion:nil];
}
}
@ -278,7 +284,7 @@
[self.signUpPasswordInput setText:@""];
// [appDelegate showFirstTimeUser];
[appDelegate reloadFeedsView:YES];
[self dismissViewControllerAnimated:NO completion:nil];
[self dismissViewControllerAnimated:YES completion:nil];
}
}

View file

@ -506,7 +506,7 @@
self.storyPageControl.nextPage.webView.hidden = YES;
self.storyPageControl.bottomSize.hidden = NO;
self.storyPageControl.navigationItem.rightBarButtonItems = nil;
[self.storyPageControl resetPages];
[self.storyPageControl hidePages];
NSInteger unreadCount = appDelegate.unreadCount;
if (unreadCount == 0) {
self.storyPageControl.circularProgressView.percentage = 1;
@ -521,8 +521,7 @@
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
// CASE: story titles on bottom
self.storyPageControl.navigationItem.leftBarButtonItem = self.storyPageControl.buttonBack;
self.storyPageControl.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:self.feedDetailViewController.rightToolbar];
self.storyPageControl.navigationItem.rightBarButtonItems = self.feedDetailViewController.navigationItem.rightBarButtonItems;
self.storyNavigationController.view.frame = CGRectMake(vb.size.width, 0, vb.size.width, storyTitlesYCoordinate);
self.feedDetailViewController.view.frame = CGRectMake(vb.size.width,

View file

@ -9,7 +9,6 @@
#import <UIKit/UIKit.h>
#import "BaseViewController.h"
#import "FMDatabaseQueue.h"
#import "NBBarButtonItem.h"
#define FEED_DETAIL_VIEW_TAG 1000001
#define STORY_DETAIL_VIEW_TAG 1000002
@ -353,7 +352,6 @@
+ (UIView *)makeGradientView:(CGRect)rect startColor:(NSString *)start endColor:(NSString *)end;
- (UIView *)makeFeedTitleGradient:(NSDictionary *)feed withRect:(CGRect)rect;
- (UIView *)makeFeedTitle:(NSDictionary *)feed;
- (NBBarButtonItem *)makeRightFeedTitle:(NSDictionary *)feed;
- (void)toggleAuthorClassifier:(NSString *)author feedId:(NSString *)feedId;
- (void)toggleTagClassifier:(NSString *)tag feedId:(NSString *)feedId;

View file

@ -193,7 +193,7 @@
// [[UISegmentedControl appearance] setBackgroundColor:UIColorFromRGB(0x8F918B)];
[self createDatabaseConnection];
[self.feedsViewController fetchFeedList:YES];
[self.feedsViewController loadOfflineFeeds:NO];
[[PocketAPI sharedAPI] setConsumerKey:@"16638-05adf4465390446398e53b8b"];
@ -605,7 +605,6 @@
- (void)reloadFeedsView:(BOOL)showLoader {
[feedsViewController fetchFeedList:showLoader];
[loginViewController dismissViewControllerAnimated:NO completion:nil];
}
- (void)loadFeedDetailView {
@ -2190,8 +2189,6 @@
titleLabel.shadowColor = UIColorFromRGB(0xF0F0F0);
titleLabel.shadowOffset = CGSizeMake(0, 1);
titleLabel.center = CGPointMake(0, -2);
[titleLabel sizeToFit];
if (!self.isSocialView) {
titleLabel.center = CGPointMake(28, -2);
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [feed objectForKey:@"id"]];
@ -2213,23 +2210,11 @@
titleImageView.frame = CGRectMake(0.0, 2.0, 16.0, 16.0);
[titleLabel addSubview:titleImageView];
}
[titleLabel sizeToFit];
return titleLabel;
}
- (NBBarButtonItem *)makeRightFeedTitle:(NSDictionary *)feed {
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [feed objectForKey:@"id"]];
UIImage *titleImage = [Utilities getImage:feedIdStr];
titleImage = [Utilities roundCorneredImage:titleImage radius:6];
NBBarButtonItem *titleImageButton = [NBBarButtonItem buttonWithType:UIButtonTypeCustom];
titleImageButton.bounds = CGRectMake(0, 0, 32, 32);
[titleImageButton setImage:titleImage forState:UIControlStateNormal];
return titleImageButton;
}
#pragma mark -
#pragma mark Classifiers

View file

@ -26,6 +26,7 @@
#import "NBNotifier.h"
#import "Utilities.h"
#import "UIBarButtonItem+WEPopover.h"
#import "UIBarButtonItem+Image.h"
#import "AddSiteViewController.h"
#import "FMDatabase.h"
#import "FMDatabaseAdditions.h"
@ -287,7 +288,7 @@ static const CGFloat kFolderTitleHeight = 28.0f;
NSDate *decayDate = [[NSDate alloc] initWithTimeIntervalSinceNow:(BACKGROUND_REFRESH_SECONDS)];
NSLog(@"Last Update: %@ - %f", self.lastUpdate, [self.lastUpdate timeIntervalSinceDate:decayDate]);
if ([self.lastUpdate timeIntervalSinceDate:decayDate] < 0) {
[self fetchFeedList:YES];
[appDelegate reloadFeedsView:YES];
}
}
@ -320,8 +321,6 @@ static const CGFloat kFolderTitleHeight = 28.0f;
self.lastUpdate = [NSDate date];
[self showRefreshNotifier];
[self loadOfflineFeeds:NO];
}
- (void)finishedWithError:(ASIHTTPRequest *)request {
@ -332,7 +331,6 @@ static const CGFloat kFolderTitleHeight = 28.0f;
[self informError:[request error]];
self.inPullToRefresh_ = NO;
[self loadOfflineFeeds:YES];
[self showOfflineNotifier];
}
@ -350,7 +348,6 @@ static const CGFloat kFolderTitleHeight = 28.0f;
[self informError:@"The server barfed!"];
}
[self loadOfflineFeeds:YES];
[self showOfflineNotifier];
return;
}
@ -483,6 +480,7 @@ static const CGFloat kFolderTitleHeight = 28.0f;
forKey:userKey];
}
NSLog(@"Setting dictSocialFeeds");
appDelegate.dictSocialFeeds = socialDict;
[self loadAvatars];
@ -660,8 +658,12 @@ static const CGFloat kFolderTitleHeight = 28.0f;
[cursor close];
dispatch_async(dispatch_get_main_queue(), ^{
if (![[results allKeys] count] && !failed) return;
if (![[results allKeys] count] && !failed) {
NSLog(@"Fetched feeds before offline came in. Skipping offline loading.");
return;
}
[_self finishLoadingFeedListWithDict:results];
[_self fetchFeedList:NO];
});
}];
}
@ -670,7 +672,8 @@ static const CGFloat kFolderTitleHeight = 28.0f;
appDelegate.activeUserProfileId = [NSString stringWithFormat:@"%@", [appDelegate.dictSocialProfile objectForKey:@"user_id"]];
appDelegate.activeUserProfileName = [NSString stringWithFormat:@"%@", [appDelegate.dictSocialProfile objectForKey:@"username"]];
// appDelegate.activeUserProfileName = @"You";
[appDelegate showUserProfileModal:self.navigationItem.leftBarButtonItem];
[appDelegate showUserProfileModal:[self.navigationItem.leftBarButtonItems
objectAtIndex:1]];
}
- (IBAction)tapAddSite:(id)sender {
@ -1532,7 +1535,7 @@ heightForHeaderInSection:(NSInteger)section {
// called when the user pulls-to-refresh
- (void)pullToRefreshViewShouldRefresh:(PullToRefreshView *)view {
self.inPullToRefresh_ = YES;
[self fetchFeedList:NO];
[appDelegate reloadFeedsView:NO];
}
- (void)refreshFeedList {
@ -1744,36 +1747,36 @@ heightForHeaderInSection:(NSInteger)section {
NSURL *imageURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@",
[appDelegate.dictSocialProfile
objectForKey:@"photo_url"]]];
NBBarButtonItem *userAvatarButton = [NBBarButtonItem buttonWithType:UIButtonTypeCustom];
userAvatarButton.frame = CGRectMake(0, yOffset + 1, isShort ? 28 : 32, isShort ? 28 : 32);
[userAvatarButton addTarget:self action:@selector(showUserProfile) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *userAvatarButton = [UIBarButtonItem barItemWithImage:[UIImage alloc]
target:self
action:@selector(showUserProfile)];
userAvatarButton.customView.frame = CGRectMake(0, yOffset + 1, isShort ? 28 : 32, isShort ? 28 : 32);
NSMutableURLRequest *avatarRequest = [NSMutableURLRequest requestWithURL:imageURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0];
[avatarRequest setHTTPShouldHandleCookies:NO];
[avatarRequest setHTTPShouldUsePipelining:YES];
UIImageView *avatarImageView = [[UIImageView alloc] initWithFrame:userAvatarButton.frame];
UIImageView *avatarImageView = [[UIImageView alloc] initWithFrame:userAvatarButton.customView.frame];
[avatarImageView setImageWithURLRequest:avatarRequest placeholderImage:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
image = [Utilities roundCorneredImage:image radius:3];
[userAvatarButton setImage:image forState:UIControlStateNormal];
[(UIButton *)userAvatarButton.customView setImage:image forState:UIControlStateNormal];
} failure:nil];
// self.navigationItem.leftBarButtonItem = userInfoBarButton;
[userInfoView addSubview:userAvatarButton];
// [userInfoView addSubview:userAvatarButton];
int xOffset = CGRectGetMaxX(userAvatarButton.frame) + 6;
UILabel *userLabel = [[UILabel alloc] initWithFrame:CGRectMake(xOffset, yOffset, userInfoView.frame.size.width, 16)];
UILabel *userLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, yOffset, userInfoView.frame.size.width, 16)];
userLabel.text = appDelegate.activeUsername;
userLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14.0];
userLabel.textColor = UIColorFromRGB(0x404040);
userLabel.backgroundColor = [UIColor clearColor];
userLabel.shadowColor = UIColorFromRGB(0xFAFAFA);
[userLabel sizeToFit];
[userInfoView addSubview:userLabel];
[appDelegate.folderCountCache removeObjectForKey:@"everything"];
UnreadCounts *counts = [appDelegate splitUnreadCountForFolder:@"everything"];
UIImageView *yellow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"g_icn_unread"]];
yellow.frame = CGRectMake(xOffset, userLabel.frame.origin.y + userLabel.frame.size.height + 4, 8, 8);
yellow.frame = CGRectMake(0, userLabel.frame.origin.y + userLabel.frame.size.height + 4, 8, 8);
[userInfoView addSubview:yellow];
NSNumberFormatter *formatter = [NSNumberFormatter new];
@ -1804,11 +1807,19 @@ heightForHeaderInSection:(NSInteger)section {
[positiveCount sizeToFit];
[userInfoView addSubview:positiveCount];
[userInfoView setBounds:CGRectInset(userInfoView.bounds, 10, 0)];
[userInfoView sizeToFit];
UIBarButtonItem *userInfoBarButton = [[UIBarButtonItem alloc]
initWithCustomView:userInfoView];
self.navigationItem.leftBarButtonItem = userInfoBarButton;
UIBarButtonItem *spacer = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil
action:nil];
spacer.width = -8;
self.navigationItem.leftBarButtonItems = [NSArray arrayWithObjects:
spacer,
userAvatarButton,
userInfoBarButton, nil];
}
- (void)showRefreshNotifier {

View file

@ -70,6 +70,7 @@
[self.webView.scrollView addObserver:self forKeyPath:@"contentOffset"
options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld
context:nil];
self.pageIndex = -2;
self.inTextView = NO;
}

View file

@ -10,7 +10,6 @@
#import "BaseViewController.h"
#import "NewsBlurAppDelegate.h"
#import "WEPopoverController.h"
#import "TransparentToolbar.h"
#import "THCircularProgressView.h"
@class NewsBlurAppDelegate;
@ -27,7 +26,6 @@
UIButton *buttonText;
UIActivityIndicatorView *loadingIndicator;
UIBarButtonItem *buttonBack;
TransparentToolbar * rightToolbar;
UIView *traverseView;
UIView *progressView;
UIView *progressViewContainer;
@ -60,7 +58,6 @@
@property (nonatomic) IBOutlet UIBarButtonItem * spacer2BarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * spacer3BarButton;
@property (nonatomic) IBOutlet UIBarButtonItem * separatorBarButton;
@property (nonatomic) IBOutlet TransparentToolbar * rightToolbar;
@property (nonatomic) IBOutlet UIView *traverseView;
@property (nonatomic) IBOutlet UIView *progressView;
@property (nonatomic) IBOutlet UIView *progressViewContainer;
@ -84,6 +81,7 @@
- (void)transitionFromFeedDetail;
- (void)resetPages;
- (void)hidePages;
- (void)refreshPages;
- (void)refreshHeaders;
- (void)setStoryFromScroll;

View file

@ -22,7 +22,6 @@
#import "NBContainerViewController.h"
#import "DataUtilities.h"
#import "JSON.h"
#import "TransparentToolbar.h"
#import "UIBarButtonItem+Image.h"
#import "THCircularProgressView.h"
#import "FMDatabase.h"
@ -35,7 +34,6 @@
@synthesize circularProgressView;
@synthesize separatorBarButton;
@synthesize spacerBarButton, spacer2BarButton, spacer3BarButton;
@synthesize rightToolbar;
@synthesize buttonPrevious;
@synthesize buttonNext;
@synthesize buttonAction;
@ -122,9 +120,6 @@
[self.traverseView insertSubview:tapIndicator aboveSubview:circularProgressView];
self.loadingIndicator.frame = self.circularProgressView.frame;
rightToolbar = [[TransparentToolbar alloc]
initWithFrame:CGRectMake(0, 0, 86, 44)];
spacerBarButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
target:nil action:nil];
@ -173,15 +168,10 @@
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[rightToolbar setItems: [NSArray arrayWithObjects:
spacerBarButton,
fontSettingsButton,
spacer2BarButton,
separatorBarButton,
spacer3BarButton,
originalStoryButton, nil]];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
initWithCustomView:rightToolbar];
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
originalStoryButton,
separatorBarButton,
fontSettingsButton, nil];
}
[self.scrollView addObserver:self forKeyPath:@"contentOffset"
@ -194,6 +184,7 @@
- (void)viewWillAppear:(BOOL)animated {
[self setNextPreviousButtons];
[appDelegate adjustStoryDetailWebView];
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!appDelegate.isSocialView) {
@ -264,6 +255,8 @@
- (void)viewWillDisappear:(BOOL)animated {
previousPage.view.hidden = YES;
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
- (void)transitionFromFeedDetail {
@ -339,10 +332,6 @@
[nextPage clearStory];
[previousPage clearStory];
[currentPage hideStory];
[nextPage hideStory];
[previousPage hideStory];
CGRect frame = self.scrollView.frame;
self.scrollView.contentSize = frame.size;
@ -354,7 +343,12 @@
currentPage.pageIndex = -2;
nextPage.pageIndex = -2;
previousPage.pageIndex = -2;
}
- (void)hidePages {
[currentPage hideStory];
[nextPage hideStory];
[previousPage hideStory];
}
- (void)refreshPages {
@ -695,14 +689,10 @@
[self.view setNeedsLayout];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[rightToolbar setItems: [NSArray arrayWithObjects:
spacerBarButton,
fontSettingsButton,
spacer2BarButton,
separatorBarButton,
spacer3BarButton,
originalStoryButton, nil]];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightToolbar];
self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:
originalStoryButton,
separatorBarButton,
fontSettingsButton, nil];
}
[self setNextPreviousButtons];

View file

@ -2606,7 +2606,7 @@
"-all_load",
);
PRODUCT_NAME = NewsBlur;
PROVISIONING_PROFILE = "A0156932-124B-4F8E-8B93-EE6598D778F0";
PROVISIONING_PROFILE = "EB97D956-BB90-4F2F-9919-F71949B04B3F";
TARGETED_DEVICE_FAMILY = "1,2";
"WARNING_CFLAGS[arch=*]" = "-Wall";
};
@ -2638,7 +2638,7 @@
"-all_load",
);
PRODUCT_NAME = NewsBlur;
PROVISIONING_PROFILE = "A0156932-124B-4F8E-8B93-EE6598D778F0";
PROVISIONING_PROFILE = "EB97D956-BB90-4F2F-9919-F71949B04B3F";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};

View file

@ -13,11 +13,13 @@
+(UIBarButtonItem *)barItemWithImage:(UIImage *)image target:(id)target action:(SEL)action
{
UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
button.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
[button setImage:image forState:UIControlStateNormal];
[button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
[button sizeToFit];
// button.imageView.contentMode = UIViewContentModeCenter;
UIBarButtonItem* item = [[self alloc] initWithCustomView:button];
// button.layer.borderColor = [[UIColor redColor] CGColor];
// button.layer.borderWidth = 0.5f;
return item;
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F37" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
@ -131,14 +131,14 @@
<color key="shadowColor" cocoaTouchSystemColor="darkTextColor"/>
</label>
<segmentedControl contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="bar" selectedSegmentIndex="0" id="33">
<rect key="frame" x="-3" y="0.0" width="329" height="30"/>
<rect key="frame" x="-4" y="0.0" width="329" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.90980398650000005" green="0.91764712329999998" blue="0.89411771299999998" alpha="1" colorSpace="deviceRGB"/>
<color key="backgroundColor" red="0.91764712333679199" green="0.92156869173049927" blue="0.94117653369903564" alpha="1" colorSpace="deviceRGB"/>
<segments>
<segment title="Login"/>
<segment title="Signup"/>
<segment title="LOGIN"/>
<segment title="SIGNUP"/>
</segments>
<color key="tintColor" red="0.1960784314" green="0.30980392159999998" blue="0.52156862749999999" alpha="1" colorSpace="calibratedRGB"/>
<color key="tintColor" white="0.94625342150000002" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<action selector="selectLoginSignup" destination="-1" eventType="valueChanged" id="42"/>
</connections>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB