From 5f20f4b61b4d3a9398e77315fbca7cca3ced9cf4 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 29 Apr 2013 11:28:15 -0700 Subject: [PATCH] Fixing close email/sms dialogs uiactivity. --- media/ios/Classes/NBContainerViewController.m | 70 +++++++++---------- .../ios/Classes/OriginalStoryViewController.m | 7 +- media/ios/Classes/StoryPageControl.m | 12 ++-- media/ios/Entitlements.entitlements | 2 +- media/ios/NewsBlur.xcodeproj/project.pbxproj | 16 ++--- .../xcdebugger/Breakpoints.xcbkptlist | 13 ++++ .../Other Sources/ShareThis/EmailService.m | 13 ++-- 7 files changed, 80 insertions(+), 53 deletions(-) diff --git a/media/ios/Classes/NBContainerViewController.m b/media/ios/Classes/NBContainerViewController.m index 016075a36..4012b9602 100644 --- a/media/ios/Classes/NBContainerViewController.m +++ b/media/ios/Classes/NBContainerViewController.m @@ -447,7 +447,7 @@ [self hidePopover]; self.feedDetailIsVisible = YES; CGRect vb = [self.view bounds]; - + // adding feedDetailViewController [self addChildViewController:self.feedDetailViewController]; [self.view addSubview:self.feedDetailViewController.view]; @@ -471,39 +471,39 @@ self.storyPageControl.circularProgressView.percentage = 0; } - UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; - if (UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) { - // CASE: story titles on bottom - self.storyPageControl.navigationItem.leftBarButtonItem = self.storyPageControl.buttonBack; - - self.storyNavigationController.view.frame = CGRectMake(vb.size.width, 0, vb.size.width, storyTitlesYCoordinate); - self.feedDetailViewController.view.frame = CGRectMake(vb.size.width, - self.storyTitlesYCoordinate, - vb.size.width, - vb.size.height - storyTitlesYCoordinate); - float largeTimeInterval = NB_DEFAULT_SLIDER_INTERVAL * ( vb.size.width - NB_DEFAULT_MASTER_WIDTH) / vb.size.width; - float smallTimeInterval = NB_DEFAULT_SLIDER_INTERVAL * NB_DEFAULT_MASTER_WIDTH / vb.size.width; - - [UIView animateWithDuration:largeTimeInterval delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ - self.storyNavigationController.view.frame = CGRectMake(NB_DEFAULT_MASTER_WIDTH + 1, 0, vb.size.width, self.storyTitlesYCoordinate); - self.feedDetailViewController.view.frame = CGRectMake(NB_DEFAULT_MASTER_WIDTH + 1, - self.storyTitlesYCoordinate, - vb.size.width, - vb.size.height - storyTitlesYCoordinate); - } completion:^(BOOL finished) { - [UIView animateWithDuration:smallTimeInterval delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ - self.storyNavigationController.view.frame = CGRectMake(0, 0, vb.size.width, self.storyTitlesYCoordinate); - self.feedDetailViewController.view.frame = CGRectMake(0, self.storyTitlesYCoordinate, vb.size.width, vb.size.height - storyTitlesYCoordinate); - self.masterNavigationController.view.frame = CGRectMake(-NB_DEFAULT_MASTER_WIDTH, 0, NB_DEFAULT_MASTER_WIDTH, vb.size.height); - } completion:^(BOOL finished) { - [self.dashboardViewController.view removeFromSuperview]; - [self.masterNavigationController.view removeFromSuperview]; - }]; - }]; - - UIView *titleLabel = [appDelegate makeFeedTitle:appDelegate.activeFeed]; - self.storyPageControl.navigationItem.titleView = titleLabel; - } else { +// UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; +// if (NO && UIInterfaceOrientationIsPortrait(orientation) && !self.storyTitlesOnLeft) { +// // CASE: story titles on bottom +// self.storyPageControl.navigationItem.leftBarButtonItem = self.storyPageControl.buttonBack; +// +// self.storyNavigationController.view.frame = CGRectMake(vb.size.width, 0, vb.size.width, storyTitlesYCoordinate); +// self.feedDetailViewController.view.frame = CGRectMake(vb.size.width, +// self.storyTitlesYCoordinate, +// vb.size.width, +// vb.size.height - storyTitlesYCoordinate); +// float largeTimeInterval = NB_DEFAULT_SLIDER_INTERVAL * ( vb.size.width - NB_DEFAULT_MASTER_WIDTH) / vb.size.width; +// float smallTimeInterval = NB_DEFAULT_SLIDER_INTERVAL * NB_DEFAULT_MASTER_WIDTH / vb.size.width; +// +// [UIView animateWithDuration:largeTimeInterval delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{ +// self.storyNavigationController.view.frame = CGRectMake(NB_DEFAULT_MASTER_WIDTH + 1, 0, vb.size.width, self.storyTitlesYCoordinate); +// self.feedDetailViewController.view.frame = CGRectMake(NB_DEFAULT_MASTER_WIDTH + 1, +// self.storyTitlesYCoordinate, +// vb.size.width, +// vb.size.height - storyTitlesYCoordinate); +// } completion:^(BOOL finished) { +// [UIView animateWithDuration:smallTimeInterval delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ +// self.storyNavigationController.view.frame = CGRectMake(0, 0, vb.size.width, self.storyTitlesYCoordinate); +// self.feedDetailViewController.view.frame = CGRectMake(0, self.storyTitlesYCoordinate, vb.size.width, vb.size.height - storyTitlesYCoordinate); +// self.masterNavigationController.view.frame = CGRectMake(-NB_DEFAULT_MASTER_WIDTH, 0, NB_DEFAULT_MASTER_WIDTH, vb.size.height); +// } completion:^(BOOL finished) { +// [self.dashboardViewController.view removeFromSuperview]; +// [self.masterNavigationController.view removeFromSuperview]; +// }]; +// }]; +// +// UIView *titleLabel = [appDelegate makeFeedTitle:appDelegate.activeFeed]; +// self.storyPageControl.navigationItem.titleView = titleLabel; +// } else { // CASE: story titles on left [self.masterNavigationController pushViewController:self.feedDetailViewController @@ -523,7 +523,7 @@ self.storyPageControl.navigationItem.titleView = nil; self.storyPageControl.navigationItem.leftBarButtonItem = nil; - } +// } } - (void)transitionFromFeedDetail { diff --git a/media/ios/Classes/OriginalStoryViewController.m b/media/ios/Classes/OriginalStoryViewController.m index 31a707797..065c993da 100644 --- a/media/ios/Classes/OriginalStoryViewController.m +++ b/media/ios/Classes/OriginalStoryViewController.m @@ -7,6 +7,7 @@ // #import "NewsBlurAppDelegate.h" +#import "NBContainerViewController.h" #import "OriginalStoryViewController.h" #import "NSString+HTML.h" #import "TransparentToolbar.h" @@ -299,7 +300,11 @@ NSURL *url = [NSURL URLWithString:self.pageUrl.text]; NSString *title = [appDelegate.activeStory objectForKey:@"story_title"]; - [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self]; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self.appDelegate.masterContainerViewController]; + } else { + [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self]; + } } @end diff --git a/media/ios/Classes/StoryPageControl.m b/media/ios/Classes/StoryPageControl.m index 2cb3e22c9..cf9a4f392 100644 --- a/media/ios/Classes/StoryPageControl.m +++ b/media/ios/Classes/StoryPageControl.m @@ -311,9 +311,9 @@ UITouch *theTouch = [touches anyObject]; if ([theTouch.view isKindOfClass: UIToolbar.class] || [theTouch.view isKindOfClass: UIView.class]) { self.inTouchMove = YES; - CGPoint touchLocation = [theTouch locationInView:self.view]; - CGFloat y = touchLocation.y; - [appDelegate.masterContainerViewController dragStoryToolbar:y]; +// CGPoint touchLocation = [theTouch locationInView:self.view]; +// CGFloat y = touchLocation.y; +// [appDelegate.masterContainerViewController dragStoryToolbar:y]; } } } @@ -765,7 +765,11 @@ objectForKey:@"story_permalink"]]; NSString *title = [appDelegate.activeStory objectForKey:@"story_title"]; - [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self]; + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self.appDelegate.masterContainerViewController]; + } else { + [ShareThis showShareOptionsToShareUrl:url title:title image:nil onViewController:self]; + } } - (void)markStoryAsSaved { diff --git a/media/ios/Entitlements.entitlements b/media/ios/Entitlements.entitlements index fe238e5c4..c468210c7 100644 --- a/media/ios/Entitlements.entitlements +++ b/media/ios/Entitlements.entitlements @@ -5,7 +5,7 @@ application-identifier $(AppIdentifierPrefix)$(CFBundleIdentifier) get-task-allow - + keychain-access-groups $(AppIdentifierPrefix)$(CFBundleIdentifier) diff --git a/media/ios/NewsBlur.xcodeproj/project.pbxproj b/media/ios/NewsBlur.xcodeproj/project.pbxproj index 7dbbbeb2b..1dc4456a6 100755 --- a/media/ios/NewsBlur.xcodeproj/project.pbxproj +++ b/media/ios/NewsBlur.xcodeproj/project.pbxproj @@ -2493,8 +2493,8 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = Entitlements.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc."; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: NewsBlur, Inc."; + CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -2517,8 +2517,8 @@ "-all_load", ); PRODUCT_NAME = NewsBlur; - PROVISIONING_PROFILE = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A"; + PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B"; TARGETED_DEVICE_FAMILY = "1,2"; VALID_ARCHS = armv7; "WARNING_CFLAGS[arch=*]" = "-Wall"; @@ -2532,8 +2532,8 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; CODE_SIGN_ENTITLEMENTS = Entitlements.entitlements; - CODE_SIGN_IDENTITY = "iPhone Distribution: NewsBlur, Inc."; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: NewsBlur, Inc."; + CODE_SIGN_IDENTITY = "iPhone Developer: Samuel Clay (G9HFWP68T7)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Samuel Clay (G9HFWP68T7)"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = NewsBlur_Prefix.pch; @@ -2553,8 +2553,8 @@ "-all_load", ); PRODUCT_NAME = NewsBlur; - PROVISIONING_PROFILE = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "EE8BC292-FFF2-41A0-AE29-C4B39D6A2C5A"; + PROVISIONING_PROFILE = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "3A91A886-5038-41A3-B9DB-C1A1FF5F519B"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VALID_ARCHS = armv7; diff --git a/media/ios/NewsBlur.xcodeproj/xcuserdata/sclay.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/media/ios/NewsBlur.xcodeproj/xcuserdata/sclay.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist index 94bbf0068..13aa153f8 100644 --- a/media/ios/NewsBlur.xcodeproj/xcuserdata/sclay.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist +++ b/media/ios/NewsBlur.xcodeproj/xcuserdata/sclay.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -29,6 +29,19 @@ landmarkName = "-loadRiverFeedDetailView" landmarkType = "5"> + + %@



%@", + [[params objectForKey:@"url"] absoluteString], + [[params objectForKey:@"title"] absoluteString], + [appDelegate.activeStory objectForKey:@"story_content"]]; + [mailer setMessageBody:emailBody isHTML:YES]; [viewController presentModalViewController:mailer animated:YES]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"