mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Adding appdelegate ivar to control whether activity view is showing. Needed for handling links tapped in story detail.
This commit is contained in:
parent
68078df74e
commit
6c134a1d0e
3 changed files with 10 additions and 5 deletions
|
@ -194,6 +194,7 @@
|
|||
@property (nonatomic, readwrite) BOOL popoverHasFeedView;
|
||||
@property (nonatomic, readwrite) BOOL inFeedDetail;
|
||||
@property (nonatomic, readwrite) BOOL inStoryDetail;
|
||||
@property (nonatomic, readwrite) BOOL isPresentingActivities;
|
||||
@property (readwrite) NSDictionary * activeStory;
|
||||
@property (readwrite) NSURL * activeOriginalStoryURL;
|
||||
@property (readwrite) NSDictionary * activeComment;
|
||||
|
|
|
@ -115,6 +115,7 @@
|
|||
@synthesize popoverHasFeedView;
|
||||
@synthesize inFeedDetail;
|
||||
@synthesize inStoryDetail;
|
||||
@synthesize isPresentingActivities;
|
||||
@synthesize activeComment;
|
||||
@synthesize activeShareType;
|
||||
|
||||
|
@ -581,6 +582,7 @@
|
|||
|
||||
|
||||
OSKActivityCompletionHandler completionHandler = ^(OSKActivity *activity, BOOL successful, NSError *error){
|
||||
self.isPresentingActivities = NO;
|
||||
if (!successful) return;
|
||||
|
||||
NSString *activityType = [activity.class activityType];
|
||||
|
@ -664,6 +666,8 @@
|
|||
applicationActivities:appActivities];
|
||||
[activityViewController setTitle:title];
|
||||
void (^completion)(NSString *, BOOL) = ^void(NSString *activityType, BOOL completed){
|
||||
self.isPresentingActivities = NO;
|
||||
|
||||
NSString *_completedString;
|
||||
NSLog(@"activityType: %@", activityType);
|
||||
if (!activityType) return;
|
||||
|
@ -726,7 +730,8 @@
|
|||
} else {
|
||||
[self.navigationController presentViewController:activityViewController animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
}
|
||||
self.isPresentingActivities = YES;
|
||||
}
|
||||
|
||||
- (OSKApplicationCredential *)applicationCredentialForActivityType:(NSString *)activityType {
|
||||
|
|
|
@ -1195,9 +1195,8 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
}
|
||||
|
||||
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
|
||||
// NSLog(@"Link clicked, views: %@", [UIViewController
|
||||
// osk_parentMostViewControllerForPresentingViewController:
|
||||
// appDelegate.storyPageControl].view.subviews);
|
||||
// NSLog(@"Link clicked, views: %@ = %@", appDelegate.navigationController.topViewController, appDelegate.masterContainerViewController.childViewControllers);
|
||||
if (appDelegate.isPresentingActivities) return NO;
|
||||
NSArray *subviews;
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
|
||||
subviews = [UIViewController
|
||||
|
@ -1209,7 +1208,7 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
|
|||
appDelegate.storyPageControl].view.subviews;
|
||||
}
|
||||
for (UIView *view in subviews) {
|
||||
// NSLog(@" View? %@ - %@", view, [view firstAvailableUIViewController]);
|
||||
// NSLog(@" View? %@ - %d - %@", view, [view isFirstResponder], [view firstAvailableUIViewController]);
|
||||
if ([[view firstAvailableUIViewController]
|
||||
isKindOfClass:[OSKActivitySheetViewController class]]) {
|
||||
return NO;
|
||||
|
|
Loading…
Add table
Reference in a new issue