Fixing close email/sms dialogs uiactivity.

This commit is contained in:
Samuel Clay 2013-04-29 11:28:15 -07:00
parent 6c75fe1d43
commit 5f20f4b61b
7 changed files with 80 additions and 53 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -5,7 +5,7 @@
<key>application-identifier</key>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>get-task-allow</key>
<false/>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>

View file

@ -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;

View file

@ -29,6 +29,19 @@
landmarkName = "-loadRiverFeedDetailView"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Other Sources/ShareThis/ShareThis.m"
timestampString = "388952533.179322"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "88"
endingLineNumber = "88"
landmarkName = "+shareURL:title:image:withService:onViewController:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
<SymbolicBreakpoints>
<SymbolicBreakpoint

View file

@ -1,6 +1,7 @@
/* Copyright 2012 IGN Entertainment, Inc. */
#import "EmailService.h"
#import "NewsBlurAppDelegate.h"
static EmailService *_manager;
@ -25,11 +26,15 @@ static EmailService *_manager;
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
[[mailer navigationBar] setTintColor:[UIColor blackColor]];
mailer.mailComposeDelegate = self;
mailer.modalPresentationStyle = UIModalPresentationPageSheet;
mailer.modalPresentationStyle = UIModalPresentationCurrentContext;
[mailer setSubject:[params objectForKey:@"title"]];
NSString *emailBody = [[params objectForKey:@"url"] absoluteString];
[mailer setMessageBody:emailBody isHTML:NO];
NewsBlurAppDelegate *appDelegate = [NewsBlurAppDelegate sharedAppDelegate];
NSString *emailBody = [NSString stringWithFormat:@"<p><a href=\"%@\">%@</a></p><hr><br>%@",
[[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"