diff --git a/clients/ios/Classes/FeedDetailTableCell.h b/clients/ios/Classes/FeedDetailTableCell.h index 53dba1d87..7e754e1e1 100644 --- a/clients/ios/Classes/FeedDetailTableCell.h +++ b/clients/ios/Classes/FeedDetailTableCell.h @@ -22,7 +22,7 @@ UIImage *storyImage; NSInteger storyTimestamp; int storyScore; - BOOL isStarred; + BOOL isSaved; BOOL isShared; BOOL inDashboard; @@ -43,7 +43,7 @@ @property (nonatomic) UIImage *siteFavicon; @property (readwrite) int storyScore; -@property (nonatomic, readwrite) BOOL isStarred; +@property (nonatomic, readwrite) BOOL isSaved; @property (readwrite) BOOL isShared; @property (nonatomic) NSString *storyTitle; diff --git a/clients/ios/Classes/FeedDetailTableCell.m b/clients/ios/Classes/FeedDetailTableCell.m index 96d3e2946..4c3fb07ae 100644 --- a/clients/ios/Classes/FeedDetailTableCell.m +++ b/clients/ios/Classes/FeedDetailTableCell.m @@ -36,7 +36,7 @@ static UIFont *indicatorFont = nil; @synthesize siteFavicon; @synthesize isRead; @synthesize isShared; -@synthesize isStarred; +@synthesize isSaved; @synthesize isShort; @synthesize isRiverOrSocial; @synthesize feedColorBar; @@ -84,7 +84,7 @@ static UIFont *indicatorFont = nil; unreadIcon = @"g_icn_unread.png"; } - UIColor *shareColor = self.isStarred ? + UIColor *shareColor = self.isSaved ? UIColorFromRGB(0xF69E89) : UIColorFromRGB(0xA4D97B); UIColor *readColor = self.isRead ? @@ -236,7 +236,7 @@ static UIFont *indicatorFont = nil; storyTitleY = 12 + riverPadding - (theSize.height/font.pointSize*2); } int storyTitleX = leftMargin; - if (cell.isStarred) { + if (cell.isSaved) { UIImage *savedIcon = [UIImage imageNamed:@"clock"]; [savedIcon drawInRect:CGRectMake(storyTitleX, storyTitleY - 1, 16, 16) blendMode:nil alpha:1]; storyTitleX += 20; diff --git a/clients/ios/Classes/FeedDetailViewController.m b/clients/ios/Classes/FeedDetailViewController.m index 6a92ea7bd..7af81a9a8 100644 --- a/clients/ios/Classes/FeedDetailViewController.m +++ b/clients/ios/Classes/FeedDetailViewController.m @@ -1117,7 +1117,7 @@ cell.storyDate = [story objectForKey:@"short_parsed_date"]; cell.storyTimestamp = [[story objectForKey:@"story_timestamp"] integerValue]; - cell.isStarred = [[story objectForKey:@"starred"] boolValue]; + cell.isSaved = [[story objectForKey:@"starred"] boolValue]; cell.isShared = [[story objectForKey:@"shared"] boolValue]; cell.storyImageUrl = nil; if (self.showImagePreview && @@ -1244,7 +1244,7 @@ FeedDetailTableCell *cell = (FeedDetailTableCell*) [self.storyTitlesTable cellForRowAtIndexPath:indexPath]; cell.isRead = ![storiesCollection isStoryUnread:appDelegate.activeStory]; cell.isShared = [[appDelegate.activeStory objectForKey:@"shared"] boolValue]; - cell.isStarred = [[appDelegate.activeStory objectForKey:@"starred"] boolValue]; + cell.isSaved = [[appDelegate.activeStory objectForKey:@"starred"] boolValue]; [cell setNeedsDisplay]; } diff --git a/clients/ios/Classes/FeedTableCell.h b/clients/ios/Classes/FeedTableCell.h index 20a70fd98..1a18a7bfc 100644 --- a/clients/ios/Classes/FeedTableCell.h +++ b/clients/ios/Classes/FeedTableCell.h @@ -21,6 +21,7 @@ int _negativeCount; NSString *_negativeCountStr; BOOL isSocial; + BOOL isSaved; UIView *cellContent; UnreadCountView *unreadCount; } @@ -32,6 +33,7 @@ @property (assign, nonatomic) int neutralCount; @property (assign, nonatomic) int negativeCount; @property (assign, nonatomic) BOOL isSocial; +@property (assign, nonatomic) BOOL isSaved; @property (nonatomic) NSString *negativeCountStr; @property (nonatomic) UnreadCountView *unreadCount; diff --git a/clients/ios/Classes/FeedTableCell.m b/clients/ios/Classes/FeedTableCell.m index cb7a4e9a4..d48614b72 100644 --- a/clients/ios/Classes/FeedTableCell.m +++ b/clients/ios/Classes/FeedTableCell.m @@ -23,6 +23,7 @@ static UIFont *textFont = nil; @synthesize negativeCount = _negativeCount; @synthesize negativeCountStr; @synthesize isSocial; +@synthesize isSaved; @synthesize unreadCount; + (void) initialize{ @@ -78,6 +79,11 @@ static UIFont *textFont = nil; } - (void)setupGestures { + if (self.isSaved) { + self.shouldDrag = NO; + return; + } + [self setDelegate:(NewsBlurViewController *)appDelegate.feedsViewController]; [self setFirstStateIconName:self.isSocial ? @"menu_icn_fetch_subscribers.png" : @"train.png" firstColor:UIColorFromRGB(0xA4D97B) @@ -137,7 +143,7 @@ static UIFont *textFont = nil; } [cell.unreadCount drawInRect:r ps:cell.positiveCount nt:cell.neutralCount - listType:(cell.isSocial ? NBFeedListSocial : NBFeedListFeed)]; + listType:(cell.isSocial ? NBFeedListSocial : cell.isSaved ? NBFeedListSaved : NBFeedListFeed)]; UIColor *textColor = cell.highlighted || cell.selected ? @@ -184,7 +190,6 @@ static UIFont *textFont = nil; NSForegroundColorAttributeName: textColor, NSParagraphStyleAttributeName: paragraphStyle}]; } - } else { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [cell.feedFavicon drawInRect:CGRectMake(12.0, 7.0, 16.0, 16.0)]; @@ -203,8 +208,6 @@ static UIFont *textFont = nil; } - (void)redrawUnreadCounts { -// [cell.unreadCount drawInRect:self.frame ps:cell.positiveCount nt:cell.neutralCount -// listType:(cell.isSocial ? NBFeedListSocial : NBFeedListFeed)]; cell.unreadCount.psCount = cell.positiveCount; cell.unreadCount.ntCount = cell.neutralCount; [cell.unreadCount setNeedsLayout]; diff --git a/clients/ios/Classes/NewsBlurViewController.m b/clients/ios/Classes/NewsBlurViewController.m index f359a4218..cabf6ccc3 100644 --- a/clients/ios/Classes/NewsBlurViewController.m +++ b/clients/ios/Classes/NewsBlurViewController.m @@ -894,7 +894,10 @@ static UIFont *userLabelFont; id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:indexPath.row]; NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId]; BOOL isSocial = [appDelegate isSocialFeed:feedIdStr]; - + BOOL isSaved = [appDelegate isSavedFeed:feedIdStr]; + + if (isSaved) return; + [self performSelector:@selector(highlightCell:) withObject:cell afterDelay:0.0]; if ([longPressTitle isEqualToString:@"mark_read_choose_days"]) { @@ -1105,6 +1108,7 @@ static UIFont *userLabelFont; cell.neutralCount = [[unreadCounts objectForKey:@"nt"] intValue]; cell.negativeCount = [[unreadCounts objectForKey:@"ng"] intValue]; cell.isSocial = isSocial; + cell.isSaved = isSaved; [cell setNeedsDisplay]; diff --git a/clients/ios/Classes/UnreadCountView.h b/clients/ios/Classes/UnreadCountView.h index 1e101bfe4..3089d819f 100644 --- a/clients/ios/Classes/UnreadCountView.h +++ b/clients/ios/Classes/UnreadCountView.h @@ -16,7 +16,8 @@ typedef enum { NBFeedListFeed = 1, NBFeedListSocial = 2, - NBFeedListFolder = 3 + NBFeedListSaved = 3, + NBFeedListFolder = 4 } NBFeedListType; @property (nonatomic) NewsBlurAppDelegate *appDelegate;