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