Fixing original view rotation, which now messes up the story page control.

This commit is contained in:
Samuel Clay 2014-02-28 17:52:07 -08:00
parent a1521eb29e
commit 6f95207c57
4 changed files with 26 additions and 11 deletions

View file

@ -54,6 +54,7 @@
@property (readwrite) BOOL isSharingStory;
@property (readwrite) BOOL isHidingStory;
@property (readwrite) BOOL feedDetailIsVisible;
@property (readwrite) BOOL originalViewIsVisible;
@property (readwrite) BOOL keyboardIsShown;
@property (readwrite) UIDeviceOrientation rotatingToOrientation;
@ -75,6 +76,7 @@
@synthesize storyPageControl;
@synthesize shareViewController;
@synthesize feedDetailIsVisible;
@synthesize originalViewIsVisible;
@synthesize keyboardIsShown;
@synthesize storyNavigationController;
@synthesize storyTitlesYCoordinate;
@ -209,7 +211,7 @@
if (!self.feedDetailIsVisible) {
[self layoutDashboardScreen];
} else {
} else if (!self.originalViewIsVisible) {
[self layoutFeedDetailScreen];
}
}
@ -219,7 +221,7 @@
if (!self.feedDetailIsVisible) {
[self layoutDashboardScreen];
} else {
} else if (!self.originalViewIsVisible) {
[self layoutFeedDetailScreen];
}
}
@ -696,6 +698,8 @@
CGRect vb = [self.view bounds];
self.originalViewIsVisible = YES;
if (resetLayout) {
[self addChildViewController:self.originalNavigationController];
[self.originalNavigationController.view setHidden:NO];
@ -724,12 +728,14 @@
animations:^
{
if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) {
self.storyNavigationController.view.frame = CGRectMake(-100, 0, vb.size.width, self.storyTitlesYCoordinate);
self.storyNavigationController.view.transform = CGAffineTransformMakeTranslation(-100, 0);
// self.storyNavigationController.view.frame = CGRectMake(-100, 0, vb.size.width, self.storyTitlesYCoordinate);
self.feedDetailViewController.view.frame = CGRectMake(-100, self.storyTitlesYCoordinate, vb.size.width, vb.size.height - storyTitlesYCoordinate);
self.masterNavigationController.view.frame = CGRectMake(-1 * self.masterWidth, 0, self.masterWidth, vb.size.height);
} else {
self.masterNavigationController.view.frame = CGRectMake(-100, 0, self.masterWidth, vb.size.height);
self.storyNavigationController.view.frame = CGRectMake(-100 + self.masterWidth - 1, 0, vb.size.width - self.masterWidth + 1, vb.size.height);
self.storyNavigationController.view.transform = CGAffineTransformMakeTranslation(-95, 0);
// self.storyNavigationController.view.frame = CGRectMake(-100 + self.masterWidth - 1, 0, vb.size.width - self.masterWidth + 1, vb.size.height);
}
self.originalNavigationController.view.frame = CGRectMake(0, 0,
@ -747,6 +753,7 @@
NSLog(@"Transition from Original View");
[self.originalViewController viewWillDisappear:YES];
self.originalViewIsVisible = NO;
[UIView animateWithDuration:0.35 delay:0
options:UIViewAnimationOptionCurveEaseOut
@ -808,6 +815,7 @@
[self.view insertSubview:self.dashboardViewController.view atIndex:0];
[self.view addSubview:self.masterNavigationController.view];
CGRect storyNavFrame = self.storyNavigationController.view.frame;
storyNavFrame.origin.x = self.masterWidth - 1 + storyNavFrame.size.width * percentage;
self.storyNavigationController.view.frame = storyNavFrame;

View file

@ -1466,6 +1466,7 @@ heightForHeaderInSection:(NSInteger)section {
id feedId = [[appDelegate.dictFolders objectForKey:folderName] objectAtIndex:self.currentRowAtIndexPath.row];
NSString *feedIdStr = [NSString stringWithFormat:@"%@",feedId];
NSDictionary *unreadCounts = [appDelegate.dictUnreadCounts objectForKey:feedIdStr];
if (![cell respondsToSelector:@selector(setPositiveCount:)]) return;
[cell setPositiveCount:[[unreadCounts objectForKey:@"ps"] intValue]];
[cell setNeutralCount:[[unreadCounts objectForKey:@"nt"] intValue]];
[cell setNegativeCount:[[unreadCounts objectForKey:@"ng"] intValue]];

View file

@ -1461,6 +1461,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
}
- (void)changeWebViewWidth {
NSLog(@"changeWebViewWidth: %@", NSStringFromCGRect(self.view.frame));
int contentWidth = self.appDelegate.storyPageControl.view.frame.size.width;
NSString *contentWidthClass;

View file

@ -301,6 +301,11 @@
}
- (void)layoutForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad &&
// appDelegate.masterContainerViewController.originalViewIsVisible) {
// return;
// }
NSLog(@"layout for stories: %@", NSStringFromCGRect(self.view.frame));
if (interfaceOrientation != _orientation) {
_orientation = interfaceOrientation;
[self refreshPages];