Saved story feeds shouldnt have long presses or swipes.

This commit is contained in:
Samuel Clay 2014-05-20 12:58:04 -07:00
parent d26b6825b7
commit cdaf7c0f70
7 changed files with 23 additions and 13 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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];
}

View file

@ -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;

View file

@ -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 <MCSwipeTableViewCellDelegate> *)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];

View file

@ -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];

View file

@ -16,7 +16,8 @@
typedef enum {
NBFeedListFeed = 1,
NBFeedListSocial = 2,
NBFeedListFolder = 3
NBFeedListSaved = 3,
NBFeedListFolder = 4
} NBFeedListType;
@property (nonatomic) NewsBlurAppDelegate *appDelegate;