diff --git a/media/iphone/Classes/NewsBlurAppDelegate.h b/media/iphone/Classes/NewsBlurAppDelegate.h index 5adade450..7f1422f2d 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.h +++ b/media/iphone/Classes/NewsBlurAppDelegate.h @@ -170,6 +170,7 @@ - (BOOL)isSocialFeed:(NSString *)feedIdStr; +- (int)indexOfNextUnreadStory; - (int)indexOfNextStory; - (int)indexOfPreviousStory; - (int)indexOfActiveStory; diff --git a/media/iphone/Classes/NewsBlurAppDelegate.m b/media/iphone/Classes/NewsBlurAppDelegate.m index 24c30ee66..ba1616d13 100644 --- a/media/iphone/Classes/NewsBlurAppDelegate.m +++ b/media/iphone/Classes/NewsBlurAppDelegate.m @@ -529,7 +529,7 @@ [originalStoryViewController dismissModalViewControllerAnimated:YES]; } -- (int)indexOfNextStory { +- (int)indexOfNextUnreadStory { int activeLocation = [self locationOfActiveStory]; int readStatus = -1; for (int i=activeLocation+1; i < [self.activeFeedStoryLocations count]; i++) { @@ -553,6 +553,16 @@ return -1; } +- (int)indexOfNextStory { + int activeLocation = [self locationOfActiveStory]; + int nextStoryLocation = activeLocation + 1; + if (nextStoryLocation < [self.activeFeedStoryLocations count]) { + int location = [[self.activeFeedStoryLocations objectAtIndex:nextStoryLocation] intValue]; + return location; + } + return -1; +} + - (int)indexOfPreviousStory { NSInteger activeIndex = [self indexOfActiveStory]; return MAX(-1, activeIndex-1); diff --git a/media/iphone/Classes/StoryDetailViewController.m b/media/iphone/Classes/StoryDetailViewController.m index d8c24a28e..1f4589f2c 100644 --- a/media/iphone/Classes/StoryDetailViewController.m +++ b/media/iphone/Classes/StoryDetailViewController.m @@ -265,7 +265,7 @@ - (void)showStory { int activeLocation = appDelegate.locationOfActiveStory; - if (activeLocation >= ([appDelegate.activeFeedStories count] - 1)) { + if (activeLocation >= ([appDelegate.activeFeedStoryLocations count] - 1)) { self.buttonNextStory.enabled = NO; } else { self.buttonNextStory.enabled = YES; @@ -317,7 +317,7 @@ "
" "
" "
Post to Blurblog
" - "
Save this story
" + //"
Save this story
" "
"]; NSString *story_author = @""; if ([appDelegate.activeStory objectForKey:@"story_authors"]) { @@ -483,7 +483,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request #pragma mark Actions - (void)setNextPreviousButtons { - int nextIndex = [appDelegate indexOfNextStory]; + int nextIndex = [appDelegate indexOfNextUnreadStory]; int unreadCount = [appDelegate unreadCount]; if (nextIndex == -1 && unreadCount > 0) { [buttonNext setStyle:UIBarButtonItemStyleBordered]; @@ -550,7 +550,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } - (IBAction)doNextUnreadStory { - int nextIndex = [appDelegate indexOfNextStory]; + int nextIndex = [appDelegate indexOfNextUnreadStory]; int unreadCount = [appDelegate unreadCount]; [self.loadingIndicator stopAnimating]; @@ -594,16 +594,12 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } - (IBAction)doNextStory { - int activeLocation = appDelegate.locationOfActiveStory; - NSLog(@"activeLocation is %i", activeLocation); - - NSLog(@"[appDelegate.activeFeedStories count] is %i", [appDelegate.activeFeedStories count]); + int nextIndex = [appDelegate indexOfNextStory]; - if (activeLocation >= ([appDelegate.activeFeedStories count] - 1)) { + if (nextIndex == -1) { return; } - - int nextIndex = activeLocation + 1; + [self.loadingIndicator stopAnimating]; if (self.appDelegate.feedDetailViewController.pageFetching) { @@ -618,6 +614,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request [self markStoryAsRead]; [self setNextPreviousButtons]; [appDelegate changeActiveFeedDetailRow]; + [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.5]; [UIView setAnimationBeginsFromCurrentState:NO]; @@ -660,7 +657,6 @@ shouldStartLoadWithRequest:(NSURLRequest *)request } - (void)changeWebViewWidth:(int)width { - int contentWidth = self.view.frame.size.width; NSString *contentWidthClass; @@ -680,7 +676,6 @@ shouldStartLoadWithRequest:(NSURLRequest *)request [self.webView stringByEvaluatingJavaScriptFromString:jsString]; [contentWidthClass release]; [jsString release]; - } - (IBAction)toggleFontSize:(id)sender { diff --git a/media/iphone/Resources-iPad/Classes/StoryDetailViewController~ipad.xib b/media/iphone/Resources-iPad/Classes/StoryDetailViewController~ipad.xib index 0cfcbf169..fb7dc3c25 100644 --- a/media/iphone/Resources-iPad/Classes/StoryDetailViewController~ipad.xib +++ b/media/iphone/Resources-iPad/Classes/StoryDetailViewController~ipad.xib @@ -4480,7 +4480,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE YES - + Previous IBIPadFramework 86 1 @@ -4502,6 +4502,11 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 5 + + IBIPadFramework + 20 + + NSImage @@ -4589,14 +4594,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 59 - - - activity - - - - 65 - webView @@ -4613,6 +4610,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 79 + + + activity + + + + 81 + delegate @@ -4689,6 +4694,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + @@ -4736,6 +4742,11 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + + 80 + + + @@ -4757,6 +4768,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 47.IBPluginDependency 48.IBPluginDependency 63.IBPluginDependency + 80.IBPluginDependency YES @@ -4778,6 +4790,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -4792,7 +4805,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE - 79 + 81 @@ -6574,6 +6587,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE appDelegate buttonAction buttonNext + buttonNextStory buttonPrevious feedTitleGradient popoverController @@ -6588,6 +6602,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE UIBarButtonItem UIBarButtonItem UIBarButtonItem + UIBarButtonItem UIView UIPopoverController UIProgressView @@ -6603,6 +6618,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE appDelegate buttonAction buttonNext + buttonNextStory buttonPrevious feedTitleGradient popoverController @@ -6628,6 +6644,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE buttonNext UIBarButtonItem + + buttonNextStory + UIBarButtonItem + buttonPrevious UIBarButtonItem