adding in explicit activity categories

This commit is contained in:
Roy Yang 2012-08-13 22:48:50 -07:00
parent 37f0ebf95f
commit 049e05283a
9 changed files with 39 additions and 23 deletions

View file

@ -64,7 +64,6 @@
}
- (int)setActivity:(NSDictionary *)activity withUserProfile:(NSDictionary *)userProfile withWidth:(int)width {
// must set the height again for dynamic height in heightForRowAtIndexPath in
CGRect activityLabelRect = self.activityLabel.bounds;
activityLabelRect.size.width = width - leftMargin - avatarSize - leftMargin - rightMargin;
@ -95,10 +94,10 @@
[self.faviconView setImageWithURL:[NSURL URLWithString:[[activity objectForKey:@"with_user"] objectForKey:@"photo_url"]]
placeholderImage:nil];
} else if ([category isEqualToString:@"sharedstory"]) {
UIImage *placeholder = [UIImage imageNamed:@"user_light"];
// UIImage *placeholder = [UIImage imageNamed:@"user_light"];
[self.faviconView setImageWithURL:[NSURL URLWithString:[userProfile objectForKey:@"photo_url"]]
placeholderImage:placeholder];
} else {
placeholderImage:nil];
} else if ([category isEqualToString:@"feedsub"]) {
// UIImage *placeholder = [UIImage imageNamed:@"world"];
NSString *faviconUrl = [NSString stringWithFormat:@"http://%@/rss_feeds/icon/%i",
NEWSBLUR_URL,

View file

@ -93,7 +93,9 @@
self.activitiesPage = page;
self.pageFetching = YES;
self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/activities?user_id=%@&page=%i&limit=10",
NSString *urlString = [NSString stringWithFormat:@
"http://%@/social/activities?user_id=%@&page=%i&limit=10"
"&category=star,feedsub,follow,comment_reply,comment_like,sharedstory",
NEWSBLUR_URL,
[appDelegate.dictUserProfile objectForKey:@"user_id"],
page];
@ -207,12 +209,15 @@
NSDictionary *activitiy = [self.activitiesArray
objectAtIndex:(indexPath.row)];
NSString *category = [activitiy objectForKey:@"category"];
if (![category isEqualToString:@"follow"]) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
if ([category isEqualToString:@"follow"]) {
cell.accessoryType = UITableViewCellAccessoryNone;
} else if ([category isEqualToString:@"star"]){
cell.accessoryType = UITableViewCellAccessoryNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
} else {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
UIView *myBackView = [[UIView alloc] initWithFrame:self.frame];
myBackView.backgroundColor = UIColorFromRGB(NEWSBLUR_HIGHLIGHT_COLOR);
cell.selectedBackgroundView = myBackView;
@ -257,8 +262,8 @@
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [activity objectForKey:@"feed_id"]];
NSString *contentIdStr = nil;
[appDelegate loadTryFeedDetailView:feedIdStr withStory:contentIdStr isSocial:NO withUser:[activity objectForKey:@"with_user"] showFindingStory:NO];
}
}
// have the selected cell deselect
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}

View file

@ -71,7 +71,7 @@
self.interactionLabel.frame = interactionLabelRect;
self.avatarView.frame = CGRectMake(leftMargin, topMargin, avatarSize, avatarSize);
UIImage *placeholder = [UIImage imageNamed:@"user_light"];
// UIImage *placeholder = [UIImage imageNamed:@"user_light"];
// this is for the rare instance when the with_user doesn't return anything
if ([[interaction objectForKey:@"with_user"] class] == [NSNull class]) {
@ -79,7 +79,7 @@
}
[self.avatarView setImageWithURL:[NSURL URLWithString:[[interaction objectForKey:@"with_user"] objectForKey:@"photo_url"]]
placeholderImage:placeholder];
placeholderImage:nil];
NSString *category = [interaction objectForKey:@"category"];
NSString *content = [interaction objectForKey:@"content"];

View file

@ -95,7 +95,9 @@
self.interactionsPage = page;
self.pageFetching = YES;
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/interactions?user_id=%@&page=%i&limit=10",
NSString *urlString = [NSString stringWithFormat:@
"http://%@/social/interactions?user_id=%@&page=%i&limit=10"
"&categories=follow,comment_reply,comment_like,reply_reply,story_reshare",
NEWSBLUR_URL,
[appDelegate.dictUserProfile objectForKey:@"user_id"],
page];

View file

@ -103,12 +103,12 @@
photo_url = [photo_url stringByReplacingOccurrencesOfString:@"_normal" withString:@""];
}
UIImage *placeholder = [UIImage imageNamed:@"user_light"];
// UIImage *placeholder = [UIImage imageNamed:@"user_light"];
UIImageView *avatar = [[UIImageView alloc] init];
avatar.frame = CGRectMake(10, 10, 80, 80);
[avatar setImageWithURL:[NSURL URLWithString:photo_url]
placeholderImage:placeholder];
placeholderImage:nil];
// scale and crop image
[avatar setContentMode:UIViewContentModeScaleAspectFill];

View file

@ -834,9 +834,17 @@
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!appDelegate.isSocialView) {
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [appDelegate.activeStory objectForKey:@"story_feed_id"]];
UIImage *titleImage = appDelegate.isRiverView ?
[UIImage imageNamed:@"folder_white.png"] :
[Utilities getImage:feedIdStr];
UIImage *titleImage;
if (appDelegate.isSocialRiverView) {
titleImage = [UIImage imageNamed:@"group_white.png"];
} else if (appDelegate.isRiverView) {
titleImage = [UIImage imageNamed:@"folder_white.png"];
} else {
titleImage = [Utilities getImage:feedIdStr];
}
UIImageView *titleImageView = [[UIImageView alloc] initWithImage:titleImage];
titleImageView.frame = CGRectMake(0.0, 2.0, 16.0, 16.0);
titleImageView.hidden = YES;

View file

@ -98,7 +98,9 @@
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.labelText = @"Profiling...";
[self.profileBadge initProfile];
NSString *urlString = [NSString stringWithFormat:@"http://%@/social/profile?user_id=%@",
NSString *urlString = [NSString stringWithFormat:@
"http://%@/social/profile?user_id=%@"
"&category=follow,comment_reply,comment_like,sharedstory",
NEWSBLUR_URL,
appDelegate.activeUserProfileId];
NSURL *url = [NSURL URLWithString:urlString];

View file

@ -45,7 +45,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>NewsBlur Pro</string>
<string>NewsBlur</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

View file

@ -2332,7 +2332,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = "-ObjC";
PROVISIONING_PROFILE = "382118CB-42EB-4479-93DB-9963EFFA6DDD";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "382118CB-42EB-4479-93DB-9963EFFA6DDD";
@ -2353,7 +2353,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(BUILT_PRODUCTS_DIR)/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-ObjC";
PROVISIONING_PROFILE = "382118CB-42EB-4479-93DB-9963EFFA6DDD";