adding in slide down to comments on interactions and bug fixes

This commit is contained in:
Roy Yang 2012-07-31 23:49:51 -07:00
parent c480d5805b
commit c7287bbbe7
9 changed files with 55 additions and 2368 deletions

View file

@ -392,6 +392,7 @@
// test for tryfeed
if (appDelegate.inFindingStoryMode && appDelegate.tryFeedStoryId) {
for (int i = 0; i < appDelegate.activeFeedStories.count; i++) {
NSLog(@"i is %i", i);
NSString *storyIdStr = [[appDelegate.activeFeedStories objectAtIndex:i] objectForKey:@"id"];
if ([storyIdStr isEqualToString:appDelegate.tryFeedStoryId]) {
NSDictionary *feed = [appDelegate.activeFeedStories objectAtIndex:i];
@ -407,7 +408,8 @@
[self.storyTitlesTable selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionBottom];
FeedDetailTableCell *cell = (FeedDetailTableCell *)[self.storyTitlesTable cellForRowAtIndexPath:indexPath];
[self loadStory:cell atRow:indexPath.row];
[self loadStory:cell atRow:indexPath.row];
appDelegate.tryFeedStoryId = nil;
}
}
}

View file

@ -227,10 +227,12 @@
withStory:contentIdStr
isSocial:YES
withUser:[interaction objectForKey:@"with_user"]];
appDelegate.tryFeedCategory = category;
} else if ([category isEqualToString:@"story_reshare"]) {
NSString *feedIdStr = [NSString stringWithFormat:@"%@", [[interaction objectForKey:@"with_user"] objectForKey:@"id"]];
NSString *contentIdStr = [NSString stringWithFormat:@"%@", [interaction objectForKey:@"content_id"]];
[appDelegate loadTryFeedDetailView:feedIdStr withStory:contentIdStr isSocial:YES withUser:[interaction objectForKey:@"with_user"]];
appDelegate.tryFeedCategory = category;
}
// have the selected cell deselect

View file

@ -160,12 +160,10 @@
# pragma mark Modals and Popovers
- (void)showUserProfilePopover:(id)sender {
if (popoverController == nil) {
popoverController = [[UIPopoverController alloc]
initWithContentViewController:appDelegate.userProfileNavigationController];
popoverController.delegate = self;
}
popoverController = [[UIPopoverController alloc]
initWithContentViewController:appDelegate.userProfileNavigationController];
popoverController.delegate = self;
[popoverController setPopoverContentSize:CGSizeMake(320, 454)];

View file

@ -146,6 +146,7 @@
@property (nonatomic, readwrite) BOOL isSocialView;
@property (nonatomic, readwrite) BOOL inFindingStoryMode;
@property (nonatomic) NSString *tryFeedStoryId;
@property (nonatomic) NSString *tryFeedCategory;
@property (nonatomic, readwrite) BOOL popoverHasFeedView;
@property (nonatomic, readwrite) BOOL inFeedDetail;
@property (readwrite) NSDictionary * activeFeed;
@ -189,9 +190,6 @@
- (void)pushUserProfile;
- (void)hideUserProfileModal;
- (void)showFindFriends;
- (void)showFindingStoryHUD;
- (void)hideFindingStoryHUD;
- (void)showAddSiteModal;
- (void)showMoveSite;

View file

@ -70,6 +70,7 @@
@synthesize isSocialView;
@synthesize inFindingStoryMode;
@synthesize tryFeedStoryId;
@synthesize tryFeedCategory;
@synthesize popoverHasFeedView;
@synthesize inFeedDetail;
@synthesize activeComment;
@ -177,13 +178,13 @@
userProfileView.navigationItem.rightBarButtonItem = donebutton;
userProfileView.navigationItem.title = self.activeUserProfileName;
userProfileView.navigationItem.backBarButtonItem.title = self.activeUserProfileName;
[userProfileView getUserProfile];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[self.masterContainerViewController showUserProfilePopover:sender];
} else {
[self.navigationController presentModalViewController:navController animated:YES];
}
[userProfileView getUserProfile];
}
- (void)pushUserProfile {
@ -229,17 +230,6 @@
[self.friendsListViewController loadSuggestedFriendsList];
}
- (void)showFindingStoryHUD {
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.storyDetailViewController.view animated:YES];
HUD.labelText = @"Finding Story...";
}
- (void)hideFindingStoryHUD {
[MBProgressHUD hideHUDForView:self.storyDetailViewController.view animated:YES];
self.inFindingStoryMode = NO;
}
- (void)showShareView:(NSString *)type
setUserId:(NSString *)userId
setUsername:(NSString *)username
@ -360,6 +350,8 @@
}
- (void)loadTryFeedDetailView:(NSString *)feedId withStory:(NSString *)contentId isSocial:(BOOL)social withUser:(NSDictionary *)user {
[self.storyDetailViewController showFindingStoryHUD];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[self.navigationController popToRootViewControllerAnimated:NO];
[self.navigationController dismissModalViewControllerAnimated:YES];

View file

@ -48,6 +48,7 @@
@property (nonatomic) IBOutlet UIToolbar *bottomPlaceholderToolbar;
@property (nonatomic) IBOutlet UIBarButtonItem *fontSettingsButton;
@property (nonatomic) IBOutlet UIBarButtonItem *originalStoryButton;
@property (nonatomic) IBOutlet UILabel *noStorySelectedLabel;
- (void)setNextPreviousButtons;
@ -65,6 +66,7 @@
- (void)initStory;
- (void)showShareHUD;
- (void)showFindingStoryHUD;
- (void)refreshComments:(NSString *)replyId;
- (void)finishMarkAsRead:(ASIHTTPRequest *)request;
- (void)finishLikeComment:(ASIHTTPRequest *)request;

View file

@ -48,6 +48,7 @@
@synthesize popoverController;
@synthesize fontSettingsButton;
@synthesize originalStoryButton;
@synthesize noStorySelectedLabel;
@synthesize buttonBack;
@synthesize bottomPlaceholderToolbar;
@ -165,6 +166,7 @@
[self setInnerView:nil];
[self setBottomPlaceholderToolbar:nil];
[self setProgressViewContainer:nil];
[self setNoStorySelectedLabel:nil];
[super viewDidUnload];
}
@ -495,9 +497,11 @@
}
- (void)showStory {
NSLog(@"in showStory");
// when we show story, we mark it as read
[self markStoryAsRead];
self.noStorySelectedLabel.hidden = YES;
appDelegate.shareViewController.commentField.text = nil;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
@ -509,7 +513,7 @@
self.progressViewContainer.hidden = NO;
self.navigationItem.rightBarButtonItem = self.fontSettingsButton;
[appDelegate hideFindingStoryHUD];
[appDelegate hideShareView:YES];
[appDelegate resetShareComments];
@ -848,10 +852,22 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[MBProgressHUD hideHUDForView:self.view animated:YES];
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
if ([userPreferences integerForKey:@"fontSizing"]){
[self changeFontSize:[userPreferences stringForKey:@"fontSizing"]];
}
// see if it's a tryfeed for animation
if (appDelegate.tryFeedCategory) {
if ([appDelegate.tryFeedCategory isEqualToString:@"comment_like"] ||
[appDelegate.tryFeedCategory isEqualToString:@"comment_reply"]) {
NSString *currentUserId = [NSString stringWithFormat:@"%@", [appDelegate.dictUserProfile objectForKey:@"user_id"]];
NSString *jsFlashString = [[NSString alloc] initWithFormat:@"slideToComment('%@', true);", currentUserId];
[self.webView stringByEvaluatingJavaScriptFromString:jsFlashString];
}
appDelegate.tryFeedCategory = nil;
}
}
#pragma mark -
@ -1047,6 +1063,14 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
self.storyHUD.margin = 20.0f;
}
- (void)showFindingStoryHUD {
[MBProgressHUD hideHUDForView:self.view animated:NO];
self.storyHUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
self.storyHUD.labelText = @"Loading Story";
self.storyHUD.margin = 20.0f;
self.noStorySelectedLabel.hidden = YES;
}
- (void)refreshComments:(NSString *)replyId {
NSString *commentString = [self getComments:@"friends"];
NSString *jsString = [[NSString alloc] initWithFormat:@

View file

@ -90,8 +90,7 @@
- (void)getUserProfile {
self.view.frame = self.view.bounds;
self.contentSizeForViewInPopover = self.view.frame.size;
// [self.profileTable removeFromSuperview];
self.appDelegate = (NewsBlurAppDelegate *)[[UIApplication sharedApplication] delegate];
[MBProgressHUD hideHUDForView:self.view animated:YES];
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];