2010-07-15 00:44:38 -04:00
|
|
|
//
|
|
|
|
// FeedDetailTableCell.m
|
|
|
|
// NewsBlur
|
|
|
|
//
|
|
|
|
// Created by Samuel Clay on 7/14/10.
|
|
|
|
// Copyright 2010 NewsBlur. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2012-07-22 17:08:29 -07:00
|
|
|
#import "NewsBlurAppDelegate.h"
|
2010-07-15 00:44:38 -04:00
|
|
|
#import "FeedDetailTableCell.h"
|
2012-07-22 17:08:29 -07:00
|
|
|
#import "ABTableViewCell.h"
|
|
|
|
#import "UIView+TKCategory.h"
|
|
|
|
#import "Utilities.h"
|
2013-09-27 17:23:03 -07:00
|
|
|
#import "MCSwipeTableViewCell.h"
|
2010-07-15 00:44:38 -04:00
|
|
|
|
2012-07-22 17:08:29 -07:00
|
|
|
static UIFont *textFont = nil;
|
|
|
|
static UIFont *indicatorFont = nil;
|
2010-07-15 00:44:38 -04:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
@class FeedDetailViewController;
|
2012-07-23 10:57:11 -07:00
|
|
|
|
2010-07-15 00:44:38 -04:00
|
|
|
@implementation FeedDetailTableCell
|
|
|
|
|
|
|
|
@synthesize storyTitle;
|
|
|
|
@synthesize storyAuthor;
|
|
|
|
@synthesize storyDate;
|
2012-08-10 18:10:07 -07:00
|
|
|
@synthesize storyScore;
|
2012-07-22 14:23:50 -07:00
|
|
|
@synthesize siteTitle;
|
|
|
|
@synthesize siteFavicon;
|
2012-07-22 17:08:29 -07:00
|
|
|
@synthesize isRead;
|
2013-08-05 18:32:43 -07:00
|
|
|
@synthesize isStarred;
|
|
|
|
@synthesize isShared;
|
2012-08-08 18:23:48 -07:00
|
|
|
@synthesize isShort;
|
2012-07-22 17:08:29 -07:00
|
|
|
@synthesize isRiverOrSocial;
|
|
|
|
@synthesize feedColorBar;
|
|
|
|
@synthesize feedColorBarTopBorder;
|
2012-07-23 10:57:11 -07:00
|
|
|
@synthesize hasAlpha;
|
2010-07-15 00:44:38 -04:00
|
|
|
|
2012-08-09 11:06:38 -07:00
|
|
|
|
2013-02-21 12:19:15 -08:00
|
|
|
#define leftMargin 30
|
2012-07-22 17:08:29 -07:00
|
|
|
#define rightMargin 18
|
|
|
|
|
|
|
|
|
2012-07-22 17:21:32 -07:00
|
|
|
+ (void) initialize {
|
2012-07-22 17:08:29 -07:00
|
|
|
if (self == [FeedDetailTableCell class]) {
|
|
|
|
textFont = [UIFont boldSystemFontOfSize:18];
|
|
|
|
indicatorFont = [UIFont boldSystemFontOfSize:12];
|
2010-07-15 00:44:38 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-30 12:13:10 -07:00
|
|
|
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
|
|
|
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
|
|
|
cellContent = [[FeedDetailTableCellView alloc] initWithFrame:self.frame];
|
|
|
|
cellContent.opaque = YES;
|
|
|
|
[self.contentView addSubview:cellContent];
|
|
|
|
[self setupGestures];
|
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)drawRect:(CGRect)rect {
|
|
|
|
((FeedDetailTableCellView *)cellContent).cell = self;
|
|
|
|
cellContent.frame = rect;
|
|
|
|
[self setUnreadSwipeIcon];
|
|
|
|
[cellContent setNeedsDisplay];
|
|
|
|
}
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
- (void)setupGestures {
|
|
|
|
NSString *unreadIcon;
|
|
|
|
if (storyScore == -1) {
|
|
|
|
unreadIcon = @"g_icn_hidden.png";
|
|
|
|
} else if (storyScore == 1) {
|
|
|
|
unreadIcon = @"g_icn_focus.png";
|
|
|
|
} else {
|
|
|
|
unreadIcon = @"g_icn_unread.png";
|
|
|
|
}
|
|
|
|
|
|
|
|
appDelegate = [NewsBlurAppDelegate sharedAppDelegate];
|
2013-09-30 12:13:10 -07:00
|
|
|
[self setDelegate:(FeedDetailViewController <MCSwipeTableViewCellDelegate> *)appDelegate.feedDetailViewController];
|
2013-09-27 17:23:03 -07:00
|
|
|
[self setFirstStateIconName:@"clock.png"
|
|
|
|
firstColor:[UIColor colorWithRed:85.0 / 255.0 green:213.0 / 255.0 blue:80.0 / 255.0 alpha:1.0]
|
|
|
|
secondStateIconName:nil
|
|
|
|
secondColor:nil
|
|
|
|
thirdIconName:unreadIcon
|
|
|
|
thirdColor:[UIColor colorWithRed:254.0 / 255.0 green:217.0 / 255.0 blue:56.0 / 255.0 alpha:1.0]
|
|
|
|
fourthIconName:nil
|
|
|
|
fourthColor:nil];
|
|
|
|
|
|
|
|
// [self.contentView setBackgroundColor:[UIColor whiteColor]];
|
|
|
|
|
|
|
|
// Setting the default inactive state color to the tableView background color
|
|
|
|
// [self setDefaultColor:self.tableView.backgroundView.backgroundColor];
|
|
|
|
|
|
|
|
//
|
|
|
|
[self setSelectionStyle:UITableViewCellSelectionStyleGray];
|
|
|
|
|
|
|
|
self.mode = MCSwipeTableViewCellModeSwitch;
|
|
|
|
self.shouldAnimatesIcons = NO;
|
|
|
|
}
|
|
|
|
|
2013-09-30 12:13:10 -07:00
|
|
|
- (void)setUnreadSwipeIcon {
|
|
|
|
NSString *unreadIcon;
|
|
|
|
if (storyScore == -1) {
|
|
|
|
unreadIcon = @"g_icn_hidden.png";
|
|
|
|
} else if (storyScore == 1) {
|
|
|
|
unreadIcon = @"g_icn_focus.png";
|
|
|
|
} else {
|
|
|
|
unreadIcon = @"g_icn_unread.png";
|
|
|
|
}
|
|
|
|
|
|
|
|
[self setThirdIconName:unreadIcon];
|
|
|
|
}
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation FeedDetailTableCellView
|
|
|
|
|
|
|
|
@synthesize cell;
|
2012-07-22 17:08:29 -07:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
- (void)drawRect:(CGRect)r {
|
|
|
|
int adjustForSocial = 3;
|
|
|
|
if (cell.isRiverOrSocial) {
|
|
|
|
adjustForSocial = 20;
|
|
|
|
}
|
|
|
|
|
2012-07-22 17:08:29 -07:00
|
|
|
CGContextRef context = UIGraphicsGetCurrentContext();
|
|
|
|
|
2012-07-23 10:57:11 -07:00
|
|
|
CGRect rect = CGRectInset(r, 12, 12);
|
|
|
|
rect.size.width -= 18; // Scrollbar padding
|
2013-02-14 15:36:21 -08:00
|
|
|
|
2013-09-24 17:18:20 -07:00
|
|
|
UIColor *backgroundColor;
|
2013-09-27 17:23:03 -07:00
|
|
|
backgroundColor = cell.highlighted || cell.selected ?
|
|
|
|
UIColorFromRGB(0xFFFDEF) : UIColorFromRGB(0xf4f4f4);
|
2013-09-24 17:18:20 -07:00
|
|
|
[backgroundColor set];
|
2012-07-22 17:08:29 -07:00
|
|
|
|
|
|
|
CGContextFillRect(context, r);
|
2013-02-14 15:36:21 -08:00
|
|
|
|
2012-07-22 17:08:29 -07:00
|
|
|
UIColor *textColor;
|
|
|
|
UIFont *font;
|
2013-09-27 17:23:03 -07:00
|
|
|
|
|
|
|
if (cell.isRead) {
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica" size:11];
|
|
|
|
textColor = UIColorFromRGB(0x808080);
|
2012-07-22 17:08:29 -07:00
|
|
|
} else {
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica-Bold" size:11];
|
2012-07-22 17:08:29 -07:00
|
|
|
textColor = UIColorFromRGB(0x606060);
|
|
|
|
|
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.highlighted || cell.selected) {
|
|
|
|
textColor = UIColorFromRGB(0x686868);
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
2013-09-25 17:43:00 -07:00
|
|
|
|
|
|
|
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
|
2013-10-01 14:44:13 -07:00
|
|
|
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
|
2013-09-25 17:43:00 -07:00
|
|
|
paragraphStyle.alignment = NSTextAlignmentLeft;
|
2012-07-22 17:08:29 -07:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRiverOrSocial) {
|
|
|
|
[cell.siteTitle drawInRect:CGRectMake(leftMargin + 20, 7, rect.size.width - 20, 21)
|
2013-09-25 17:43:00 -07:00
|
|
|
withAttributes:@{NSFontAttributeName: font,
|
|
|
|
NSForegroundColorAttributeName: textColor,
|
|
|
|
NSParagraphStyleAttributeName: paragraphStyle}];
|
2012-07-23 10:57:11 -07:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRead) {
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica" size:12];
|
|
|
|
textColor = UIColorFromRGB(0x606060);
|
2012-07-23 10:57:11 -07:00
|
|
|
|
|
|
|
} else {
|
|
|
|
textColor = UIColorFromRGB(0x333333);
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica-Bold" size:12];
|
2012-07-23 10:57:11 -07:00
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.highlighted || cell.selected) {
|
2012-07-28 23:31:12 -07:00
|
|
|
textColor = UIColorFromRGB(0x686868);
|
2012-07-23 10:57:11 -07:00
|
|
|
}
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
|
|
|
|
2013-09-25 17:43:00 -07:00
|
|
|
// story title
|
2013-09-27 17:23:03 -07:00
|
|
|
CGSize theSize = [cell.storyTitle
|
2013-09-25 17:43:00 -07:00
|
|
|
boundingRectWithSize:CGSizeMake(rect.size.width, 30.0)
|
2013-10-01 14:44:13 -07:00
|
|
|
options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
|
2013-09-25 17:43:00 -07:00
|
|
|
attributes:@{NSFontAttributeName: font,
|
|
|
|
NSParagraphStyleAttributeName: paragraphStyle}
|
|
|
|
context:nil].size;
|
2012-08-07 09:57:21 -07:00
|
|
|
|
2012-08-10 18:10:07 -07:00
|
|
|
int storyTitleY = 7 + adjustForSocial + ((30 - theSize.height)/2);
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isShort) {
|
2012-08-10 18:10:07 -07:00
|
|
|
storyTitleY = 7 + adjustForSocial + 2;
|
2012-08-08 18:23:48 -07:00
|
|
|
}
|
2013-08-05 17:29:42 -07:00
|
|
|
int storyTitleX = leftMargin;
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isStarred) {
|
2013-08-05 17:29:42 -07:00
|
|
|
UIImage *savedIcon = [UIImage imageNamed:@"clock"];
|
|
|
|
[savedIcon drawInRect:CGRectMake(storyTitleX, storyTitleY - 1, 16, 16) blendMode:nil alpha:1];
|
|
|
|
storyTitleX += 20;
|
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isShared) {
|
2013-08-05 17:29:42 -07:00
|
|
|
UIImage *savedIcon = [UIImage imageNamed:@"menu_icn_share"];
|
|
|
|
[savedIcon drawInRect:CGRectMake(storyTitleX, storyTitleY - 1, 16, 16) blendMode:nil alpha:1];
|
|
|
|
storyTitleX += 20;
|
|
|
|
}
|
2013-10-01 14:44:13 -07:00
|
|
|
[cell.storyTitle drawWithRect:CGRectMake(storyTitleX, storyTitleY, rect.size.width - storyTitleX + leftMargin, theSize.height)
|
|
|
|
options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
|
|
|
|
attributes:@{NSFontAttributeName: font,
|
|
|
|
NSForegroundColorAttributeName: textColor,
|
|
|
|
NSParagraphStyleAttributeName: paragraphStyle}
|
|
|
|
context:nil];
|
2013-09-27 17:23:03 -07:00
|
|
|
|
2013-07-02 16:11:14 -07:00
|
|
|
int storyAuthorDateY = 41 + adjustForSocial;
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isShort) {
|
2012-08-13 17:35:04 -07:00
|
|
|
storyAuthorDateY -= 13;
|
2012-08-08 18:23:48 -07:00
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
|
2012-07-22 17:08:29 -07:00
|
|
|
// story author style
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRead) {
|
2013-09-25 17:43:00 -07:00
|
|
|
textColor = UIColorFromRGB(0x959595);
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica" size:10];
|
2012-07-22 17:08:29 -07:00
|
|
|
} else {
|
2013-09-25 17:43:00 -07:00
|
|
|
textColor = UIColorFromRGB(0xA6A8A2);
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica-Bold" size:10];
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.highlighted || cell.selected) {
|
2012-07-28 23:31:12 -07:00
|
|
|
textColor = UIColorFromRGB(0x686868);
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
2013-09-25 17:43:00 -07:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
[cell.storyAuthor
|
2012-08-10 18:10:07 -07:00
|
|
|
drawInRect:CGRectMake(leftMargin, storyAuthorDateY, (rect.size.width) / 2 - 10, 15.0)
|
2013-09-25 17:43:00 -07:00
|
|
|
withAttributes:@{NSFontAttributeName: font,
|
|
|
|
NSForegroundColorAttributeName: textColor,
|
|
|
|
NSParagraphStyleAttributeName: paragraphStyle}];
|
2012-07-22 17:08:29 -07:00
|
|
|
// story date
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRead) {
|
2012-07-22 17:08:29 -07:00
|
|
|
textColor = UIColorFromRGB(0xbabdd1);
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica" size:10];
|
2012-07-22 17:08:29 -07:00
|
|
|
} else {
|
|
|
|
textColor = UIColorFromRGB(0x262c6c);
|
2013-07-02 16:11:14 -07:00
|
|
|
font = [UIFont fontWithName:@"Helvetica-Bold" size:10];
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.highlighted || cell.selected) {
|
2012-07-28 23:31:12 -07:00
|
|
|
textColor = UIColorFromRGB(0x686868);
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
|
|
|
|
2013-09-25 17:43:00 -07:00
|
|
|
paragraphStyle.alignment = NSTextAlignmentRight;
|
2013-09-27 17:23:03 -07:00
|
|
|
[cell.storyDate
|
|
|
|
drawInRect:CGRectMake(leftMargin + (rect.size.width) / 2 - 10, storyAuthorDateY, (rect.size.width) / 2 + 10, 15.0)
|
2013-09-25 17:43:00 -07:00
|
|
|
withAttributes:@{NSFontAttributeName: font,
|
|
|
|
NSForegroundColorAttributeName: textColor,
|
|
|
|
NSParagraphStyleAttributeName: paragraphStyle}];
|
2012-08-07 09:57:21 -07:00
|
|
|
// feed bar
|
2012-08-10 18:10:07 -07:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
CGContextSetStrokeColor(context, CGColorGetComponents([cell.feedColorBarTopBorder CGColor]));
|
|
|
|
if (cell.isRead) {
|
2013-02-21 12:19:15 -08:00
|
|
|
CGContextSetAlpha(context, 0.15);
|
2012-08-07 09:57:21 -07:00
|
|
|
}
|
2013-02-21 12:19:15 -08:00
|
|
|
CGContextSetLineWidth(context, 4.0f);
|
2012-08-11 18:03:28 -07:00
|
|
|
CGContextBeginPath(context);
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextMoveToPoint(context, 2.0f, 0);
|
|
|
|
CGContextAddLineToPoint(context, 2.0f, cell.frame.size.height);
|
2012-08-11 18:03:28 -07:00
|
|
|
CGContextStrokePath(context);
|
2013-09-27 17:23:03 -07:00
|
|
|
|
|
|
|
CGContextSetStrokeColor(context, CGColorGetComponents([cell.feedColorBar CGColor]));
|
2012-08-13 17:35:04 -07:00
|
|
|
CGContextBeginPath(context);
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextMoveToPoint(context, 6.0f, 0);
|
|
|
|
CGContextAddLineToPoint(context, 6.0, cell.frame.size.height);
|
2012-08-13 17:35:04 -07:00
|
|
|
CGContextStrokePath(context);
|
2012-08-07 09:57:21 -07:00
|
|
|
|
2012-08-08 12:02:54 -07:00
|
|
|
// reset for borders
|
2013-09-30 10:26:19 -07:00
|
|
|
UIColor *white = UIColorFromRGB(0xffffff);
|
2012-08-08 12:02:54 -07:00
|
|
|
CGContextSetAlpha(context, 1.0);
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.highlighted || cell.selected) {
|
2012-07-23 10:57:11 -07:00
|
|
|
// top border
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextSetStrokeColor(context, CGColorGetComponents([white CGColor]));
|
2012-07-23 10:57:11 -07:00
|
|
|
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextSetLineWidth(context, 1.0f);
|
2012-07-23 10:57:11 -07:00
|
|
|
CGContextBeginPath(context);
|
2012-07-28 23:31:12 -07:00
|
|
|
CGContextMoveToPoint(context, 0, 0.5f);
|
2013-09-27 17:23:03 -07:00
|
|
|
CGContextAddLineToPoint(context, cell.bounds.size.width, 0.5f);
|
2012-07-23 10:57:11 -07:00
|
|
|
CGContextStrokePath(context);
|
|
|
|
|
2013-09-30 10:26:19 -07:00
|
|
|
CGFloat lineWidth = 0.5f;
|
|
|
|
CGContextSetLineWidth(context, lineWidth);
|
|
|
|
UIColor *blue = UIColorFromRGB(0xDFDDCF);
|
|
|
|
|
|
|
|
CGContextSetStrokeColor(context, CGColorGetComponents([blue CGColor]));
|
|
|
|
|
|
|
|
CGContextBeginPath(context);
|
|
|
|
CGContextMoveToPoint(context, 0, 1.0f + 0.5f*lineWidth);
|
|
|
|
CGContextAddLineToPoint(context, cell.bounds.size.width, 1.0f + 0.5f*lineWidth);
|
|
|
|
CGContextStrokePath(context);
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
// bottom border
|
2012-07-23 10:57:11 -07:00
|
|
|
CGContextBeginPath(context);
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextMoveToPoint(context, 0, cell.bounds.size.height - .5f*lineWidth);
|
|
|
|
CGContextAddLineToPoint(context, cell.bounds.size.width, cell.bounds.size.height - .5f*lineWidth);
|
2012-07-23 10:57:11 -07:00
|
|
|
CGContextStrokePath(context);
|
|
|
|
} else {
|
|
|
|
// top border
|
2013-09-30 10:26:19 -07:00
|
|
|
CGContextSetLineWidth(context, 1.0f);
|
2012-07-23 10:57:11 -07:00
|
|
|
|
2012-08-10 18:10:07 -07:00
|
|
|
CGContextSetStrokeColor(context, CGColorGetComponents([white CGColor]));
|
2012-07-23 10:57:11 -07:00
|
|
|
|
|
|
|
CGContextBeginPath(context);
|
|
|
|
CGContextMoveToPoint(context, 0.0f, 0.5f);
|
2013-09-27 17:23:03 -07:00
|
|
|
CGContextAddLineToPoint(context, cell.bounds.size.width, 0.5f);
|
2012-07-23 10:57:11 -07:00
|
|
|
CGContextStrokePath(context);
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// site favicon
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRead && !cell.hasAlpha) {
|
|
|
|
if (cell.isRiverOrSocial) {
|
|
|
|
cell.siteFavicon = [cell imageByApplyingAlpha:cell.siteFavicon withAlpha:0.25];
|
2012-07-23 10:57:11 -07:00
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
cell.hasAlpha = YES;
|
2012-07-23 10:57:11 -07:00
|
|
|
}
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isRiverOrSocial) {
|
|
|
|
[cell.siteFavicon drawInRect:CGRectMake(leftMargin, 6.0, 16.0, 16.0)];
|
2012-08-10 18:10:07 -07:00
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
|
|
|
|
// story indicator
|
2012-08-10 18:10:07 -07:00
|
|
|
int storyIndicatorY = 4 + adjustForSocial;
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.isShort){
|
2012-08-10 18:10:07 -07:00
|
|
|
storyIndicatorY = 4 + adjustForSocial - 5 ;
|
|
|
|
}
|
2013-09-27 17:23:03 -07:00
|
|
|
|
2013-02-21 12:19:15 -08:00
|
|
|
UIImage *unreadIcon;
|
2013-09-27 17:23:03 -07:00
|
|
|
if (cell.storyScore == -1) {
|
2013-02-21 12:19:15 -08:00
|
|
|
unreadIcon = [UIImage imageNamed:@"g_icn_hidden"];
|
2013-09-27 17:23:03 -07:00
|
|
|
} else if (cell.storyScore == 1) {
|
2013-02-21 12:19:15 -08:00
|
|
|
unreadIcon = [UIImage imageNamed:@"g_icn_focus"];
|
2012-07-23 10:57:11 -07:00
|
|
|
} else {
|
2013-02-21 12:19:15 -08:00
|
|
|
unreadIcon = [UIImage imageNamed:@"g_icn_unread"];
|
2012-08-10 18:10:07 -07:00
|
|
|
}
|
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
[unreadIcon drawInRect:CGRectMake(15, storyIndicatorY + 14, 8, 8) blendMode:nil alpha:(cell.isRead ? .15 : 1)];
|
2012-07-22 17:08:29 -07:00
|
|
|
}
|
2010-07-15 00:44:38 -04:00
|
|
|
|
2013-09-27 17:23:03 -07:00
|
|
|
@end
|