mirror of
https://github.com/viq/NewsBlur.git
synced 2025-11-01 09:09:16 +00:00
Completing feed view of saved story tags. Need to update counts and fix tags with spaces.
This commit is contained in:
parent
4e96b02504
commit
e0268b9c76
8 changed files with 66 additions and 22 deletions
|
|
@ -155,7 +155,7 @@ static UIFont *indicatorFont = nil;
|
|||
alpha = 0.34f;
|
||||
}
|
||||
[storyImageView.image drawInRect:imageFrame blendMode:Nil alpha:alpha];
|
||||
rect.size.width -= r.size.height;
|
||||
rect.size.width -= imageFrame.size.width;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +289,8 @@ static UIFont *indicatorFont = nil;
|
|||
}
|
||||
|
||||
[cell.storyContent
|
||||
drawWithRect:CGRectMake(storyTitleX, storyContentY, storyContentWidth, contentSize.height)
|
||||
drawWithRect:CGRectMake(storyTitleX, storyContentY,
|
||||
rect.size.width - storyTitleX + leftMargin, contentSize.height)
|
||||
options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
|
||||
attributes:@{NSFontAttributeName: font,
|
||||
NSForegroundColorAttributeName: textColor,
|
||||
|
|
|
|||
|
|
@ -270,14 +270,14 @@
|
|||
|
||||
if ((storiesCollection.isSocialRiverView ||
|
||||
storiesCollection.isSocialView ||
|
||||
[storiesCollection.activeFolder isEqualToString:@"saved_stories"])) {
|
||||
storiesCollection.isSavedView)) {
|
||||
settingsBarButton.enabled = NO;
|
||||
} else {
|
||||
settingsBarButton.enabled = YES;
|
||||
}
|
||||
|
||||
if (storiesCollection.isSocialRiverView ||
|
||||
[storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
storiesCollection.isSavedView) {
|
||||
feedMarkReadButton.enabled = NO;
|
||||
} else {
|
||||
feedMarkReadButton.enabled = YES;
|
||||
|
|
@ -537,6 +537,12 @@
|
|||
NEWSBLUR_URL,
|
||||
[storiesCollection.activeFeed objectForKey:@"user_id"],
|
||||
storiesCollection.feedPage];
|
||||
} else if (storiesCollection.isSavedView) {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"%@/reader/starred_stories/?page=%d&v=2&tag=%@",
|
||||
NEWSBLUR_URL,
|
||||
storiesCollection.feedPage,
|
||||
storiesCollection.activeSavedStoryTag];
|
||||
} else {
|
||||
theFeedDetailURL = [NSString stringWithFormat:@"%@/reader/feed/%@/?page=%d",
|
||||
NEWSBLUR_URL,
|
||||
|
|
@ -730,9 +736,9 @@
|
|||
NEWSBLUR_URL,
|
||||
storiesCollection.feedPage];
|
||||
}
|
||||
} else if ([storiesCollection.activeFolder isEqual:@"saved_stories"]) {
|
||||
} else if (storiesCollection.isSavedView) {
|
||||
theFeedDetailURL = [NSString stringWithFormat:
|
||||
@"%@/reader/starred_stories/?page=%d",
|
||||
@"%@/reader/starred_stories/?page=%d&v=2",
|
||||
NEWSBLUR_URL,
|
||||
storiesCollection.feedPage];
|
||||
} else {
|
||||
|
|
@ -817,13 +823,15 @@
|
|||
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
|
||||
|
||||
if (!(storiesCollection.isRiverView ||
|
||||
storiesCollection.isSavedView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView)
|
||||
&& request.tag != [feedId intValue]) {
|
||||
return;
|
||||
}
|
||||
if (storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
storiesCollection.isSocialRiverView ||
|
||||
storiesCollection.isSavedView) {
|
||||
NSArray *newFeeds = [results objectForKey:@"feeds"];
|
||||
for (int i = 0; i < newFeeds.count; i++){
|
||||
NSString *feedKey = [NSString stringWithFormat:@"%@", [[newFeeds objectAtIndex:i] objectForKey:@"id"]];
|
||||
|
|
@ -835,6 +843,7 @@
|
|||
|
||||
NSMutableDictionary *newClassifiers = [[results objectForKey:@"classifiers"] mutableCopy];
|
||||
if (storiesCollection.isRiverView ||
|
||||
storiesCollection.isSavedView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
for (id key in [newClassifiers allKeys]) {
|
||||
|
|
@ -1073,7 +1082,9 @@
|
|||
}
|
||||
|
||||
|
||||
if (storiesCollection.isRiverView || storiesCollection.isSocialView) {
|
||||
if (storiesCollection.isRiverView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSavedView) {
|
||||
cellIdentifier = @"FeedRiverDetailCellIdentifier";
|
||||
} else {
|
||||
cellIdentifier = @"FeedDetailCellIdentifier";
|
||||
|
|
@ -1097,7 +1108,8 @@
|
|||
id feedId = [story objectForKey:@"story_feed_id"];
|
||||
NSString *feedIdStr = [NSString stringWithFormat:@"%@", feedId];
|
||||
|
||||
if (storiesCollection.isSocialView || storiesCollection.isSocialRiverView) {
|
||||
if (storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
feed = [appDelegate.dictActiveFeeds objectForKey:feedIdStr];
|
||||
// this is to catch when a user is already subscribed
|
||||
if (!feed) {
|
||||
|
|
@ -1180,6 +1192,7 @@
|
|||
|
||||
cell.isRiverOrSocial = NO;
|
||||
if (storiesCollection.isRiverView ||
|
||||
storiesCollection.isSavedView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
cell.isRiverOrSocial = YES;
|
||||
|
|
@ -1221,6 +1234,9 @@
|
|||
feedTitle = @"Global Shared Stories";
|
||||
} else if ([storiesCollection.activeFolder isEqualToString:@"everything"]) {
|
||||
feedTitle = @"All Stories";
|
||||
} else if (storiesCollection.isSavedView && storiesCollection.activeSavedStoryTag) {
|
||||
feedTitle = [NSString stringWithFormat:@"Saved Stories - %@",
|
||||
storiesCollection.activeSavedStoryTag];
|
||||
} else if ([storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
feedTitle = @"Saved Stories";
|
||||
} else {
|
||||
|
|
@ -1305,6 +1321,7 @@ heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|||
if (storyCount && indexPath.row == storyCount) {
|
||||
return 40;
|
||||
} else if (storiesCollection.isRiverView ||
|
||||
storiesCollection.isSavedView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
NSInteger height = kTableViewRiverRowHeight;
|
||||
|
|
|
|||
|
|
@ -1117,6 +1117,7 @@
|
|||
[self.folderCountCache removeAllObjects];
|
||||
} else if ([folder isEqualToString:@"saved_stories"]) {
|
||||
feedDetailView.storiesCollection.isRiverView = YES;
|
||||
feedDetailView.storiesCollection.isSavedView = YES;
|
||||
[feedDetailView.storiesCollection setActiveFolder:folder];
|
||||
} else {
|
||||
feedDetailView.storiesCollection.isRiverView = YES;
|
||||
|
|
@ -1967,7 +1968,8 @@
|
|||
UIView *gradientView;
|
||||
if (storiesCollection.isRiverView ||
|
||||
storiesCollection.isSocialView ||
|
||||
storiesCollection.isSocialRiverView) {
|
||||
storiesCollection.isSocialRiverView ||
|
||||
storiesCollection.isSavedView) {
|
||||
gradientView = [NewsBlurAppDelegate
|
||||
makeGradientView:rect
|
||||
startColor:[feed objectForKey:@"favicon_fade"]
|
||||
|
|
@ -2028,8 +2030,9 @@
|
|||
} else if (storiesCollection.isRiverView &&
|
||||
[storiesCollection.activeFolder isEqualToString:@"everything"]) {
|
||||
titleLabel.text = [NSString stringWithFormat:@" All Stories"];
|
||||
} else if (storiesCollection.isRiverView &&
|
||||
[storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
} else if (storiesCollection.isSavedView && storiesCollection.activeSavedStoryTag) {
|
||||
titleLabel.text = [NSString stringWithFormat:@" Saved Stories - %@", storiesCollection.activeSavedStoryTag];
|
||||
} else if ([storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
titleLabel.text = [NSString stringWithFormat:@" Saved Stories"];
|
||||
} else if (storiesCollection.isRiverView) {
|
||||
titleLabel.text = [NSString stringWithFormat:@" %@", storiesCollection.activeFolder];
|
||||
|
|
@ -2060,8 +2063,9 @@
|
|||
} else if (storiesCollection.isRiverView &&
|
||||
[storiesCollection.activeFolder isEqualToString:@"everything"]) {
|
||||
titleImage = [UIImage imageNamed:@"ak-icon-allstories.png"];
|
||||
} else if (storiesCollection.isRiverView &&
|
||||
[storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
} else if (storiesCollection.isSavedView && storiesCollection.activeSavedStoryTag) {
|
||||
titleImage = [UIImage imageNamed:@"tag.png"];
|
||||
} else if ([storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
titleImage = [UIImage imageNamed:@"clock.png"];
|
||||
} else if (storiesCollection.isRiverView) {
|
||||
titleImage = [UIImage imageNamed:@"g_icn_folder.png"];
|
||||
|
|
|
|||
|
|
@ -585,7 +585,9 @@ static UIFont *userLabelFont;
|
|||
if ([[userTag objectForKey:@"tag"] isEqualToString:@""]) continue;
|
||||
NSString *savedTagId = [NSString stringWithFormat:@"saved:%@", [userTag objectForKey:@"tag"]];
|
||||
NSDictionary *savedTag = @{@"ps": [userTag objectForKey:@"count"],
|
||||
@"feed_title": [userTag objectForKey:@"tag"]};
|
||||
@"feed_title": [userTag objectForKey:@"tag"],
|
||||
@"id": [userTag objectForKey:@"tag"],
|
||||
@"tag": [userTag objectForKey:@"tag"]};
|
||||
[savedStories addObject:savedTagId];
|
||||
[savedStoryDict setObject:savedTag forKey:savedTagId];
|
||||
[appDelegate.dictUnreadCounts setObject:@{@"ps": [userTag objectForKey:@"count"],
|
||||
|
|
@ -1144,9 +1146,16 @@ static UIFont *userLabelFont;
|
|||
if ([appDelegate isSocialFeed:feedIdStr]) {
|
||||
feed = [appDelegate.dictSocialFeeds objectForKey:feedIdStr];
|
||||
appDelegate.storiesCollection.isSocialView = YES;
|
||||
appDelegate.storiesCollection.isSavedView = NO;
|
||||
} else if ([appDelegate isSavedFeed:feedIdStr]) {
|
||||
feed = [appDelegate.dictSavedStoryTags objectForKey:feedIdStr];
|
||||
appDelegate.storiesCollection.isSocialView = NO;
|
||||
appDelegate.storiesCollection.isSavedView = YES;
|
||||
appDelegate.storiesCollection.activeSavedStoryTag = [feed objectForKey:@"tag"];
|
||||
} else {
|
||||
feed = [appDelegate.dictFeeds objectForKey:feedIdStr];
|
||||
appDelegate.storiesCollection.isSocialView = NO;
|
||||
appDelegate.storiesCollection.isSavedView = NO;
|
||||
}
|
||||
|
||||
// If all feeds are already showing, no need to remember this one.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
@property (nonatomic) NewsBlurAppDelegate *appDelegate;
|
||||
@property (readwrite) NSDictionary * activeFeed;
|
||||
@property (nonatomic) NSString * activeSavedStoryTag;
|
||||
@property (readwrite) NSString * activeFolder;
|
||||
@property (readwrite) NSArray * activeFolderFeeds;
|
||||
@property (readwrite) NSArray * activeFeedStories;
|
||||
|
|
@ -49,6 +50,7 @@
|
|||
@property (nonatomic, readwrite) BOOL isRiverView;
|
||||
@property (nonatomic, readwrite) BOOL isSocialView;
|
||||
@property (nonatomic, readwrite) BOOL isSocialRiverView;
|
||||
@property (nonatomic, readwrite) BOOL isSavedView;
|
||||
@property (nonatomic, readwrite) BOOL transferredFromDashboard;
|
||||
|
||||
- (id)initForDashboard;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
@synthesize activeClassifiers;
|
||||
@synthesize activePopularTags;
|
||||
@synthesize activePopularAuthors;
|
||||
@synthesize activeSavedStoryTag;
|
||||
@synthesize activeFolder;
|
||||
@synthesize activeFolderFeeds;
|
||||
@synthesize activeFeedStories;
|
||||
|
|
@ -33,6 +34,7 @@
|
|||
@synthesize isRiverView;
|
||||
@synthesize isSocialView;
|
||||
@synthesize isSocialRiverView;
|
||||
@synthesize isSavedView;
|
||||
@synthesize transferredFromDashboard;
|
||||
|
||||
|
||||
|
|
@ -60,6 +62,7 @@
|
|||
|
||||
self.feedPage = 1;
|
||||
self.activeFeed = nil;
|
||||
self.activeSavedStoryTag = nil;
|
||||
self.activeFolder = nil;
|
||||
self.activeFolderFeeds = nil;
|
||||
self.activeClassifiers = [NSMutableDictionary dictionary];
|
||||
|
|
@ -68,6 +71,7 @@
|
|||
self.isRiverView = NO;
|
||||
self.isSocialView = NO;
|
||||
self.isSocialRiverView = NO;
|
||||
self.isSavedView = NO;
|
||||
}
|
||||
|
||||
- (void)transferStoriesFromCollection:(StoriesCollection *)fromCollection {
|
||||
|
|
|
|||
|
|
@ -241,7 +241,8 @@
|
|||
}
|
||||
|
||||
NSString *riverClass = (appDelegate.storiesCollection.isRiverView ||
|
||||
appDelegate.storiesCollection.isSocialView) ?
|
||||
appDelegate.storiesCollection.isSocialView ||
|
||||
appDelegate.storiesCollection.isSavedView) ?
|
||||
@"NB-river" : @"NB-non-river";
|
||||
|
||||
// set up layout values based on iPad/iPhone
|
||||
|
|
@ -337,7 +338,8 @@
|
|||
}
|
||||
|
||||
if (appDelegate.storiesCollection.isRiverView ||
|
||||
appDelegate.storiesCollection.isSocialView) {
|
||||
appDelegate.storiesCollection.isSocialView ||
|
||||
appDelegate.storiesCollection.isSavedView) {
|
||||
self.webView.scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(20, 0, 0, 0);
|
||||
} else {
|
||||
self.webView.scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(9, 0, 0, 0);
|
||||
|
|
@ -1166,7 +1168,8 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
// only adjust for the bar if user is scrolling
|
||||
if (appDelegate.storiesCollection.isRiverView ||
|
||||
appDelegate.storiesCollection.isSocialView) {
|
||||
appDelegate.storiesCollection.isSocialView ||
|
||||
appDelegate.storiesCollection.isSavedView) {
|
||||
if (self.webView.scrollView.contentOffset.y == -20) {
|
||||
y = y + 20;
|
||||
}
|
||||
|
|
@ -1389,7 +1392,8 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
// only adjust for the bar if user is scrolling
|
||||
if (appDelegate.storiesCollection.isRiverView ||
|
||||
appDelegate.storiesCollection.isSocialView) {
|
||||
appDelegate.storiesCollection.isSocialView ||
|
||||
appDelegate.storiesCollection.isSavedView) {
|
||||
if (self.webView.scrollView.contentOffset.y == -20) {
|
||||
y = y + 20;
|
||||
}
|
||||
|
|
@ -1533,7 +1537,8 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
contentWidthClass = @"NB-iphone";
|
||||
}
|
||||
NSString *riverClass = (appDelegate.storiesCollection.isRiverView ||
|
||||
appDelegate.storiesCollection.isSocialView) ?
|
||||
appDelegate.storiesCollection.isSocialView ||
|
||||
appDelegate.storiesCollection.isSavedView) ?
|
||||
@"NB-river" : @"NB-non-river";
|
||||
|
||||
NSString *jsString = [[NSString alloc] initWithFormat:
|
||||
|
|
|
|||
|
|
@ -204,8 +204,10 @@
|
|||
} else if (appDelegate.storiesCollection.isRiverView &&
|
||||
[appDelegate.storiesCollection.activeFolder isEqualToString:@"everything"]) {
|
||||
titleImage = [UIImage imageNamed:@"ak-icon-allstories.png"];
|
||||
} else if (appDelegate.storiesCollection.isRiverView &&
|
||||
[appDelegate.storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
} else if (appDelegate.storiesCollection.isSavedView &&
|
||||
appDelegate.storiesCollection.activeSavedStoryTag) {
|
||||
titleImage = [UIImage imageNamed:@"tag.png"];
|
||||
} else if ([appDelegate.storiesCollection.activeFolder isEqualToString:@"saved_stories"]) {
|
||||
titleImage = [UIImage imageNamed:@"clock.png"];
|
||||
} else if (appDelegate.storiesCollection.isRiverView) {
|
||||
titleImage = [UIImage imageNamed:@"g_icn_folder.png"];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue