From 022ee05ed5e48e18bbef6dbc05651786972c2c3d Mon Sep 17 00:00:00 2001 From: Gonzalo Gonzalez Date: Tue, 26 Aug 2014 19:22:30 +0200 Subject: [PATCH 1/6] Working in OC-4762 task --- .../MGSplitViewController.m | 76 +++++++++++++++++-- .../Preview/DetailView/DetailViewController.m | 27 +++++++ Owncloud iOs Client/Utils/SystemConstants.h | 1 + 3 files changed, 96 insertions(+), 8 deletions(-) diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m index 42df8ca92e..25063daa6c 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m @@ -77,7 +77,9 @@ - (NSString *)nameOfInterfaceOrientation:(UIInterfaceOrientation)theOrientation - (BOOL)isLandscape { - return UIInterfaceOrientationIsLandscape(self.interfaceOrientation); + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + return UIInterfaceOrientationIsLandscape(orientation); } @@ -90,7 +92,9 @@ - (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrien - (BOOL)shouldShowMaster { - return [self shouldShowMasterForInterfaceOrientation:self.interfaceOrientation]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + return [self shouldShowMasterForInterfaceOrientation:orientation]; } @@ -99,6 +103,12 @@ - (BOOL)isShowingMaster return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); } +- (UIInterfaceOrientation)theInterfaceOrientation{ + + return [[UIApplication sharedApplication] statusBarOrientation]; + +} + #pragma mark - #pragma mark Setup and Teardown @@ -241,9 +251,49 @@ - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrie } +#pragma mark - iOS 8 rotation method. + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { + + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + NSTimeInterval duration = 0.5; + + // willRotateToInterfaceOrientation code goes here + [self willRotateToInterfaceOrientation:orientation duration:duration]; + + [coordinator animateAlongsideTransition:^(id context) { + // willAnimateRotationToInterfaceOrientation code goes here + [self willAnimateRotationToInterfaceOrientation:orientation duration:duration]; + + // Hide popover. + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } + + // Re-tile views. + _reconfigurePopup = YES; + [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:YES]; + + AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication]delegate]; + [app.detailViewController adjustGalleryScrollView]; + + + + } completion:^(id context) { + // didRotateFromInterfaceOrientation goes here (nothing for now) + [self didRotateFromInterfaceOrientation:orientation]; + }]; + + + [super viewWillTransitionToSize: size withTransitionCoordinator: coordinator]; +} + + - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation { - UIScreen *screen = [UIScreen mainScreen]; + UIScreen *screen = [UIScreen mainScreen]; + CGRect fullScreenRect = screen.bounds; // always implicitly in Portrait orientation. CGRect appFrame = screen.applicationFrame; @@ -256,7 +306,7 @@ - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation float height = fullScreenRect.size.height; // Correct for orientation. - if (UIInterfaceOrientationIsLandscape(theOrientation)) { + if (UIInterfaceOrientationIsLandscape(theOrientation) && [[[UIDevice currentDevice] systemVersion] floatValue] < 8) { width = height; height = fullScreenRect.size.width; } @@ -521,13 +571,18 @@ - (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrienta - (void)layoutSubviewsWithAnimation:(BOOL)animate { - [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:animate]; + + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:animate]; } - (void)layoutSubviews { - [self layoutSubviewsForInterfaceOrientation:self.interfaceOrientation withAnimation:YES]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:YES]; } @@ -622,7 +677,11 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover } //Define the size of the popOver - _hiddenPopoverController.popoverContentSize=CGSizeMake(320, [[UIScreen mainScreen] bounds].size.height); + + + UIScreen *screen = [UIScreen mainScreen]; + + _hiddenPopoverController.popoverContentSize=CGSizeMake(320, screen.bounds.size.height); // Inform delegate of this state of affairs. if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:)]) { @@ -908,7 +967,8 @@ - (void)setSplitPosition:(float)posn // Check to see if delegate wishes to constrain the position. float newPosn = posn; BOOL constrained = NO; - CGSize fullSize = [self splitViewSizeForOrientation:self.interfaceOrientation]; + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + CGSize fullSize = [self splitViewSizeForOrientation:orientation]; if (_delegate && [_delegate respondsToSelector:@selector(splitViewController:constrainSplitPosition:splitViewSize:)]) { newPosn = [_delegate splitViewController:self constrainSplitPosition:newPosn splitViewSize:fullSize]; constrained = YES; // implicitly trust delegate's response. diff --git a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m index 4c739a889f..da74cd027c 100755 --- a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m +++ b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m @@ -2008,6 +2008,33 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO [self showPopover]; } + +#pragma mark - iOS 8 rotation method. + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { + + UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; + + NSTimeInterval duration = 0.5; + + // willRotateToInterfaceOrientation code goes here + [self willRotateToInterfaceOrientation:orientation duration:duration]; + + [coordinator animateAlongsideTransition:^(id context) { + // willAnimateRotationToInterfaceOrientation code goes here + [self willAnimateRotationToInterfaceOrientation:orientation duration:duration]; + + + } completion:^(id context) { + // didRotateFromInterfaceOrientation goes here (nothing for now) + [self didRotateFromInterfaceOrientation:orientation]; + + }]; + + + [super viewWillTransitionToSize: size withTransitionCoordinator: coordinator]; +} + /* * Method that tell to galleryView to adjust the scroll view after the rotation */ diff --git a/Owncloud iOs Client/Utils/SystemConstants.h b/Owncloud iOs Client/Utils/SystemConstants.h index 4b27899ec0..9e54876692 100644 --- a/Owncloud iOs Client/Utils/SystemConstants.h +++ b/Owncloud iOs Client/Utils/SystemConstants.h @@ -7,5 +7,6 @@ // #define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) +#define IS_IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8) #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define IS_PORTRAIT (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait) || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) \ No newline at end of file From 405ac612a1de636fe3209cb1311d22c6cba9bc3c Mon Sep 17 00:00:00 2001 From: Gonzalo Gonzalez Date: Thu, 28 Aug 2014 09:44:20 +0200 Subject: [PATCH 2/6] Working in the last bug --- .../MGSplitViewController.m | 91 +++++++++---------- Owncloud iOs Client/Utils/SystemConstants.h | 2 +- 2 files changed, 42 insertions(+), 51 deletions(-) diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m index 25063daa6c..65d5d9ed19 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m @@ -77,9 +77,7 @@ - (NSString *)nameOfInterfaceOrientation:(UIInterfaceOrientation)theOrientation - (BOOL)isLandscape { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - return UIInterfaceOrientationIsLandscape(orientation); + return UIInterfaceOrientationIsLandscape([self getTheInterfaceOrientation]); } @@ -87,14 +85,23 @@ - (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrien { // Returns YES if master view should be shown directly embedded in the splitview, instead of hidden in a popover. return ((UIInterfaceOrientationIsLandscape(theOrientation)) ? _showsMasterInLandscape : _showsMasterInPortrait); + + /* if (UIInterfaceOrientationIsLandscape(theOrientation) ) { + if (_showsMasterInLandscape) { + return YES; + }else{ + return NO; + } + }else{ + return NO; + }*/ + } - (BOOL)shouldShowMaster { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - return [self shouldShowMasterForInterfaceOrientation:orientation]; + return [self shouldShowMasterForInterfaceOrientation:[self getTheInterfaceOrientation]]; } @@ -103,7 +110,7 @@ - (BOOL)isShowingMaster return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); } -- (UIInterfaceOrientation)theInterfaceOrientation{ +- (UIInterfaceOrientation)getTheInterfaceOrientation{ return [[UIApplication sharedApplication] statusBarOrientation]; @@ -186,12 +193,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface //Only for ios 6 - (BOOL)shouldAutorotate { - UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; - - if (orientation==UIInterfaceOrientationPortrait) { - - } - return YES; } @@ -204,8 +205,10 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrie - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [self.masterViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; [self.detailViewController didRotateFromInterfaceOrientation:fromInterfaceOrientation]; + } @@ -222,7 +225,8 @@ - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInte // Re-tile views. _reconfigurePopup = YES; - [self layoutSubviewsForInterfaceOrientation:toInterfaceOrientation withAnimation:YES]; + [self layoutSubviews]; + AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication]delegate]; [app.detailViewController adjustGalleryScrollView]; @@ -255,34 +259,19 @@ - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrie - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - NSTimeInterval duration = 0.5; + NSTimeInterval duration = 0.0; // willRotateToInterfaceOrientation code goes here - [self willRotateToInterfaceOrientation:orientation duration:duration]; + [self willRotateToInterfaceOrientation:[self getTheInterfaceOrientation] duration:duration]; + [self reconfigureForMasterInPopover:NO]; [coordinator animateAlongsideTransition:^(id context) { // willAnimateRotationToInterfaceOrientation code goes here - [self willAnimateRotationToInterfaceOrientation:orientation duration:duration]; - - // Hide popover. - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - } - - // Re-tile views. - _reconfigurePopup = YES; - [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:YES]; - - AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication]delegate]; - [app.detailViewController adjustGalleryScrollView]; - - + [self willAnimateRotationToInterfaceOrientation:[self getTheInterfaceOrientation] duration:duration]; } completion:^(id context) { // didRotateFromInterfaceOrientation goes here (nothing for now) - [self didRotateFromInterfaceOrientation:orientation]; + [self didRotateFromInterfaceOrientation:[self getTheInterfaceOrientation]]; }]; @@ -328,7 +317,7 @@ - (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrienta if (_reconfigurePopup) { [self reconfigureForMasterInPopover:![self shouldShowMasterForInterfaceOrientation:theOrientation]]; } - + // Layout the master, detail and divider views appropriately, adding/removing subviews as needed. // First obtain relevant geometry. CGSize fullSize = [self splitViewSizeForOrientation:theOrientation]; @@ -571,18 +560,13 @@ - (void)layoutSubviewsForInterfaceOrientation:(UIInterfaceOrientation)theOrienta - (void)layoutSubviewsWithAnimation:(BOOL)animate { - - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:animate]; + [self layoutSubviewsForInterfaceOrientation:[self getTheInterfaceOrientation] withAnimation:animate]; } - (void)layoutSubviews { - UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; - - [self layoutSubviewsForInterfaceOrientation:orientation withAnimation:YES]; + [self layoutSubviewsForInterfaceOrientation:[self getTheInterfaceOrientation] withAnimation:YES]; } @@ -692,8 +676,12 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover } } else if (!inPopover && _hiddenPopoverController && _barButtonItem) { - // I know this looks strange, but it fixes a bizarre issue with UIPopoverController leaving masterViewController's views in disarray. - [_hiddenPopoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; + + if (!IS_IOS8) { + // I know this looks strange, but it fixes a bizarre issue with UIPopoverController leaving masterViewController's views in disarray. + [_hiddenPopoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:NO]; + } + // Remove master from popover and destroy popover, if it exists. [_hiddenPopoverController dismissPopoverAnimated:NO]; @@ -712,10 +700,12 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover _barButtonItem = nil; // Move master view. - UIView *masterView = self.masterViewController.view; - if (masterView && masterView.superview != self.view) { - [masterView removeFromSuperview]; - } + if (!IS_IOS8) { + UIView *masterView = self.masterViewController.view; + if (masterView && masterView.superview != self.view) { + [masterView removeFromSuperview]; + } + } } } @@ -806,12 +796,13 @@ - (IBAction)toggleMasterView:(id)sender _reconfigurePopup = YES; [self reconfigureForMasterInPopover:NO]; [self layoutSubviews]; - } + } // This action functions on the current primary orientation; it is independent of the other primary orientation. [UIView beginAnimations:@"toggleMaster" context:nil]; if (self.isLandscape) { - self.showsMasterInLandscape = !_showsMasterInLandscape; + + self.showsMasterInLandscape = !_showsMasterInLandscape; } else { self.showsMasterInPortrait = !_showsMasterInPortrait; } diff --git a/Owncloud iOs Client/Utils/SystemConstants.h b/Owncloud iOs Client/Utils/SystemConstants.h index 9e54876692..8d7516e13a 100644 --- a/Owncloud iOs Client/Utils/SystemConstants.h +++ b/Owncloud iOs Client/Utils/SystemConstants.h @@ -6,7 +6,7 @@ // // -#define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) +#define IS_IOS7 ([[[UIDevice currentDevice] systemVersion] floatValue] == 7) #define IS_IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8) #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define IS_PORTRAIT (([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortrait) || [[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationPortraitUpsideDown) \ No newline at end of file From 5d1000f9cbfe8529bd1896ebe929889ecc406463 Mon Sep 17 00:00:00 2001 From: Gonzalo Gonzalez Date: Thu, 28 Aug 2014 12:51:37 +0200 Subject: [PATCH 3/6] Bufg Oc-4813 is fixed --- .../MGSplitViewController.h | 2 +- .../MGSplitViewController.m | 41 ++++++++++++--- .../Preview/DetailView/DetailViewController.m | 50 +++++++++++-------- 3 files changed, 64 insertions(+), 29 deletions(-) diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.h b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.h index bf7bf62156..d15ad79f86 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.h +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.h @@ -59,7 +59,7 @@ typedef enum _MGSplitViewDividerStyle { - (IBAction)toggleMasterView:(id)sender; // toggles display of the master view in the current orientation. - (IBAction)showMasterPopover:(id)sender; // shows the master view in a popover spawned from the provided barButtonItem, if it's currently hidden. - (void)notePopoverDismissed; // should rarely be needed, because you should not change the popover's delegate. If you must, then call this when it's dismissed. - +- (void) removeThePopover; // Conveniences for you, because I care. - (BOOL)isShowingMaster; - (void)setSplitPosition:(float)posn animated:(BOOL)animate; // Allows for animation of splitPosition changes. The property's regular setter is not animated. diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m index 65d5d9ed19..cada8aa015 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m @@ -107,12 +107,21 @@ - (BOOL)shouldShowMaster - (BOOL)isShowingMaster { - return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); + BOOL showingMaster = NO; + + + if ([self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view)) { + showingMaster = YES; + } + + return showingMaster; + + //return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); } - (UIInterfaceOrientation)getTheInterfaceOrientation{ - return [[UIApplication sharedApplication] statusBarOrientation]; + return [[UIApplication sharedApplication] statusBarOrientation]; } @@ -263,7 +272,17 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id context) { // willAnimateRotationToInterfaceOrientation code goes here @@ -700,12 +719,12 @@ - (void)reconfigureForMasterInPopover:(BOOL)inPopover _barButtonItem = nil; // Move master view. - if (!IS_IOS8) { + // if (!IS_IOS8) { UIView *masterView = self.masterViewController.view; if (masterView && masterView.superview != self.view) { [masterView removeFromSuperview]; } - } + // } } } @@ -784,12 +803,18 @@ - (IBAction)toggleMasterBeforeDetail:(id)sender } } +- (void) removeThePopover{ + + if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + [_hiddenPopoverController dismissPopoverAnimated:NO]; + } +} - (IBAction)toggleMasterView:(id)sender { - if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { + /*if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { [_hiddenPopoverController dismissPopoverAnimated:NO]; - } + }*/ if (![self isShowingMaster]) { // We're about to show the master view. Ensure it's in place off-screen to be animated in. @@ -807,6 +832,8 @@ - (IBAction)toggleMasterView:(id)sender self.showsMasterInPortrait = !_showsMasterInPortrait; } [UIView commitAnimations]; + + } diff --git a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m index da74cd027c..3363c9b5dc 100755 --- a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m +++ b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m @@ -1901,29 +1901,37 @@ - (IBAction)toggleMasterView:(id)sender { [_galleryView prepareScrollViewBeforeTheRotation]; } - //Tell to splitController to extend the detailview - [splitController toggleMasterView:sender]; + [splitController removeThePopover]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.01 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + + //Tell to splitController to extend the detailview + [splitController toggleMasterView:sender]; + + + //Change the global flag + if (_isExtend==NO) { + //Set the constraint + _leftMarginTitleLabelConstraint.constant = 92; + _isExtend = YES; + } else { + //Set the constraint + _leftMarginTitleLabelConstraint.constant = 62; + _isExtend = NO; + } + + //Managed the objects of landscape view. + [self landscapeView]; + + //If galleryView charged indicated adjust the scroll view + if (_galleryView) { + _isExtending = YES; + [self adjustGalleryScrollView]; + } + + + }); - //Change the global flag - if (_isExtend==NO) { - //Set the constraint - _leftMarginTitleLabelConstraint.constant = 92; - _isExtend = YES; - } else { - //Set the constraint - _leftMarginTitleLabelConstraint.constant = 62; - _isExtend = NO; - } - - //Managed the objects of landscape view. - [self landscapeView]; - - //If galleryView charged indicated adjust the scroll view - if (_galleryView) { - _isExtending = YES; - [self adjustGalleryScrollView]; - } } From 4ebc9367a92090751083bcafed29717b3037d2d7 Mon Sep 17 00:00:00 2001 From: Gonzalo Gonzalez Date: Mon, 1 Sep 2014 15:13:20 +0200 Subject: [PATCH 4/6] Remove unusued code --- .../MGSplitViewController.m | 28 ++++--------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m index cada8aa015..32b1ad635d 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m @@ -85,17 +85,6 @@ - (BOOL)shouldShowMasterForInterfaceOrientation:(UIInterfaceOrientation)theOrien { // Returns YES if master view should be shown directly embedded in the splitview, instead of hidden in a popover. return ((UIInterfaceOrientationIsLandscape(theOrientation)) ? _showsMasterInLandscape : _showsMasterInPortrait); - - /* if (UIInterfaceOrientationIsLandscape(theOrientation) ) { - if (_showsMasterInLandscape) { - return YES; - }else{ - return NO; - } - }else{ - return NO; - }*/ - } @@ -109,14 +98,12 @@ - (BOOL)isShowingMaster { BOOL showingMaster = NO; - if ([self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view)) { showingMaster = YES; } return showingMaster; - //return [self shouldShowMaster] && self.masterViewController && self.masterViewController.view && ([self.masterViewController.view superview] == self.view); } - (UIInterfaceOrientation)getTheInterfaceOrientation{ @@ -273,10 +260,6 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id Date: Tue, 2 Sep 2014 09:45:49 +0200 Subject: [PATCH 5/6] Include a space --- .../Files/Preview/DetailView/DetailViewController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m index 3363c9b5dc..6730d00b3c 100755 --- a/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m +++ b/Owncloud iOs Client/Files/Preview/DetailView/DetailViewController.m @@ -700,7 +700,7 @@ - (void) openGalleryFileOnUpdatingProcess: (BOOL) isUpdatingProcess { * We use this feature for example to charge Help page. */ -- (void)finishLinkLoad{ +- (void)finishLinkLoad { [_titleLabel setText:_linkTitle]; } From 7cff3548fcc267befbf0f6a5b7e7f60517346cda Mon Sep 17 00:00:00 2001 From: RebecaMartin Date: Tue, 2 Sep 2014 10:42:41 +0200 Subject: [PATCH 6/6] Fixed the GitHub comments --- .../MGSplitViewController/MGSplitViewController.m | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m index 32b1ad635d..b4a111b9e3 100755 --- a/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m +++ b/Owncloud iOs Client/ExternalLibreries/MGSplitViewController/MGSplitViewController.m @@ -297,7 +297,7 @@ - (CGSize)splitViewSizeForOrientation:(UIInterfaceOrientation)theOrientation float height = fullScreenRect.size.height; // Correct for orientation. - if (UIInterfaceOrientationIsLandscape(theOrientation) && [[[UIDevice currentDevice] systemVersion] floatValue] < 8) { + if (UIInterfaceOrientationIsLandscape(theOrientation) && !IS_IOS8) { width = height; height = fullScreenRect.size.width; } @@ -765,8 +765,7 @@ - (IBAction)toggleSplitOrientation:(id)sender } -- (IBAction)toggleMasterBeforeDetail:(id)sender -{ +- (IBAction)toggleMasterBeforeDetail:(id)sender { BOOL showingMaster = [self isShowingMaster]; if (showingMaster) { if (_cornerViews) { @@ -785,19 +784,14 @@ - (IBAction)toggleMasterBeforeDetail:(id)sender } } -- (void) removeThePopover{ +- (void) removeThePopover { if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { [_hiddenPopoverController dismissPopoverAnimated:NO]; } } -- (IBAction)toggleMasterView:(id)sender -{ - /*if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) { - [_hiddenPopoverController dismissPopoverAnimated:NO]; - }*/ - +- (IBAction)toggleMasterView:(id)sender { if (![self isShowingMaster]) { // We're about to show the master view. Ensure it's in place off-screen to be animated in. _reconfigurePopup = YES;