mirror of
https://github.com/viq/NewsBlur.git
synced 2025-11-01 09:09:16 +00:00
tying shareview to splitstorydetail
This commit is contained in:
parent
9a1cbc5133
commit
e6f3793170
3 changed files with 81 additions and 52 deletions
|
|
@ -58,6 +58,7 @@
|
|||
NSString * activeUsername;
|
||||
BOOL isRiverView;
|
||||
BOOL isSocialView;
|
||||
BOOL isShowingShare;
|
||||
BOOL popoverHasFeedView;
|
||||
BOOL inStoryDetail;
|
||||
BOOL inFeedDetail;
|
||||
|
|
@ -110,6 +111,7 @@
|
|||
@property (readwrite, retain) NSString * activeUsername;
|
||||
@property (nonatomic, readwrite) BOOL isRiverView;
|
||||
@property (nonatomic, readwrite) BOOL isSocialView;
|
||||
@property (nonatomic, readwrite) BOOL isShowingShare;
|
||||
@property (nonatomic, readwrite) BOOL popoverHasFeedView;
|
||||
@property (nonatomic, readwrite) BOOL inStoryDetail;
|
||||
@property (nonatomic, readwrite) BOOL inFeedDetail;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
@synthesize activeUsername;
|
||||
@synthesize isRiverView;
|
||||
@synthesize isSocialView;
|
||||
@synthesize isShowingShare;
|
||||
@synthesize popoverHasFeedView;
|
||||
@synthesize inStoryDetail;
|
||||
@synthesize inFeedDetail;
|
||||
|
|
@ -205,6 +206,73 @@
|
|||
[addSiteViewController reload];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Share Views
|
||||
|
||||
- (void)showShareView:(NSString *)userId
|
||||
setUsername:(NSString *)username {
|
||||
|
||||
self.isShowingShare = YES;
|
||||
|
||||
|
||||
[splitStoryDetailViewController.view addSubview:shareViewController.view];
|
||||
|
||||
if (userId && username) {
|
||||
[shareViewController setSiteInfo:userId setUsername:username];
|
||||
}
|
||||
|
||||
|
||||
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
splitStoryDetailViewController.view.frame.size.height,
|
||||
splitStoryDetailViewController.view.frame.size.width,
|
||||
0);
|
||||
|
||||
int newShareHeight = splitStoryDetailViewController.view.frame.size.height - SHARE_MODAL_HEIGHT;
|
||||
int newStoryHeight = splitStoryDetailViewController.view.frame.size.height - SHARE_MODAL_HEIGHT + 44;
|
||||
|
||||
shareViewController.view.hidden = NO;
|
||||
|
||||
[UIView animateWithDuration:0.35 animations:^{
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
newShareHeight,
|
||||
splitStoryDetailViewController.view.frame.size.width,
|
||||
SHARE_MODAL_HEIGHT);
|
||||
} completion:^(BOOL finished) {
|
||||
storyDetailViewController.view.frame = CGRectMake(0,
|
||||
0,
|
||||
splitStoryDetailViewController.view.frame.size.width,
|
||||
newStoryHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)hideShareView {
|
||||
self.isShowingShare = NO;
|
||||
|
||||
storyDetailViewController.view.frame = CGRectMake(0,
|
||||
0,
|
||||
splitStoryDetailViewController.view.frame.size.width,
|
||||
splitStoryDetailViewController.view.frame.size.height);
|
||||
|
||||
[UIView animateWithDuration:0.35 animations:^{
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
splitStoryDetailViewController.view.frame.size.height + SHARE_MODAL_HEIGHT,
|
||||
splitStoryDetailViewController.view.frame.size.width,
|
||||
0);
|
||||
} completion:^(BOOL finished) {
|
||||
shareViewController.view.hidden = YES;
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)refreshComments {
|
||||
[storyDetailViewController refreshComments];
|
||||
}
|
||||
|
||||
- (void)resetShareComments {
|
||||
[shareViewController clearComments];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Views
|
||||
|
||||
|
|
@ -301,58 +369,6 @@
|
|||
[subviews release];
|
||||
}
|
||||
|
||||
- (void)showShareView:(NSString *)userId
|
||||
setUsername:(NSString *)username {
|
||||
|
||||
[splitStoryDetailViewController.view addSubview:shareViewController.view];
|
||||
[shareViewController setSiteInfo:userId setUsername:username];
|
||||
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
storyDetailViewController.view.frame.size.height,
|
||||
storyDetailViewController.view.frame.size.width,
|
||||
0);
|
||||
|
||||
int newShareHeight = storyDetailViewController.view.frame.size.height - SHARE_MODAL_HEIGHT;
|
||||
int newStoryHeight = storyDetailViewController.view.frame.size.height - SHARE_MODAL_HEIGHT + 44;
|
||||
|
||||
[UIView animateWithDuration:0.35 animations:^{
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
newShareHeight,
|
||||
storyDetailViewController.view.frame.size.width,
|
||||
SHARE_MODAL_HEIGHT);
|
||||
} completion:^(BOOL finished) {
|
||||
storyDetailViewController.view.frame = CGRectMake(0,
|
||||
0,
|
||||
storyDetailViewController.view.frame.size.width,
|
||||
newStoryHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)hideShareView {
|
||||
int newStoryHeight = storyDetailViewController.view.frame.size.height + SHARE_MODAL_HEIGHT - 44;
|
||||
|
||||
storyDetailViewController.view.frame = CGRectMake(0,
|
||||
0,
|
||||
storyDetailViewController.view.frame.size.width,
|
||||
newStoryHeight);
|
||||
|
||||
[UIView animateWithDuration:0.35 animations:^{
|
||||
shareViewController.view.frame = CGRectMake(0,
|
||||
storyDetailViewController.view.frame.size.height + SHARE_MODAL_HEIGHT + 44,
|
||||
storyDetailViewController.view.frame.size.width,
|
||||
0);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)refreshComments {
|
||||
[storyDetailViewController refreshComments];
|
||||
}
|
||||
|
||||
- (void)resetShareComments {
|
||||
[shareViewController clearComments];
|
||||
}
|
||||
|
||||
- (BOOL)isSocialFeed:(NSString *)feedIdStr {
|
||||
if ([feedIdStr length] > 6) {
|
||||
NSString *feedIdSubStr = [feedIdStr substringToIndex:6];
|
||||
|
|
@ -387,6 +403,12 @@
|
|||
if (!self.inFeedDetail) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.isShowingShare) {
|
||||
[self showShareView:nil setUsername:nil];
|
||||
} else {
|
||||
[self hideShareView];
|
||||
}
|
||||
|
||||
UIImage *slide;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#import "SplitStoryDetailViewController.h"
|
||||
#import "NewsBlurAppDelegate.h"
|
||||
#import "MGSplitViewController.h"
|
||||
#import "ShareViewController.h"
|
||||
|
||||
@implementation SplitStoryDetailViewController
|
||||
|
||||
|
|
@ -62,6 +63,10 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
appDelegate.shareViewController.view.hidden = YES;
|
||||
}
|
||||
|
||||
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
||||
{
|
||||
[appDelegate adjustStoryDetailWebView];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue