diff --git a/ActiveGS_iOS/activegs.xcodeproj/project.pbxproj b/ActiveGS_iOS/activegs.xcodeproj/project.pbxproj index 4417bf9..089b3d0 100644 --- a/ActiveGS_iOS/activegs.xcodeproj/project.pbxproj +++ b/ActiveGS_iOS/activegs.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ 09FA607C125A7B3E00B07F77 /* activegsList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = activegsList.mm; sourceTree = ""; }; 09FA607D125A7B3E00B07F77 /* activegsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = activegsViewController.h; sourceTree = ""; }; 09FA607E125A7B3E00B07F77 /* activegsViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = activegsViewController.mm; sourceTree = ""; }; - 09FA607F125A7B3E00B07F77 /* activegsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = activegsViewController.xib; sourceTree = ""; }; + 09FA607F125A7B3E00B07F77 /* activegsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = activegsViewController.xib; path = ../Common.iphone/activegsViewController.xib; sourceTree = ""; }; 09FA6082125A7B3E00B07F77 /* asyncimageview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asyncimageview.h; sourceTree = ""; }; 09FA6083125A7B3E00B07F77 /* asyncimageview.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = asyncimageview.mm; sourceTree = ""; }; 09FA6086125A7B3E00B07F77 /* GTMUIView+SubtreeDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GTMUIView+SubtreeDescription.h"; sourceTree = ""; }; @@ -708,6 +708,7 @@ 09B8EB85163B2C06000A9F6B /* xib */ = { isa = PBXGroup; children = ( + 09FA607F125A7B3E00B07F77 /* activegsViewController.xib */, 0916BB03129473CE001727AF /* infoViewController-ipad.xib */, 09A5CE75125D422D0018DC22 /* infoViewController.xib */, 099CD904125E6F6E008EFD6C /* detailViewController.xib */, @@ -974,7 +975,6 @@ 09FA607C125A7B3E00B07F77 /* activegsList.mm */, 09FA607D125A7B3E00B07F77 /* activegsViewController.h */, 09FA607E125A7B3E00B07F77 /* activegsViewController.mm */, - 09FA607F125A7B3E00B07F77 /* activegsViewController.xib */, 09FA6082125A7B3E00B07F77 /* asyncimageview.h */, 09FA6083125A7B3E00B07F77 /* asyncimageview.mm */, 09FA6086125A7B3E00B07F77 /* GTMUIView+SubtreeDescription.h */, diff --git a/Common.iphone/activegsAppDelegate.mm b/Common.iphone/activegsAppDelegate.mm index cbc3054..2768998 100644 --- a/Common.iphone/activegsAppDelegate.mm +++ b/Common.iphone/activegsAppDelegate.mm @@ -738,7 +738,7 @@ void x_init_persistent_path(MyString& hp) curOrientation = orientation; NSLog(@"didRotate"); - + /* if (self.primaryViewController != [pManager getEmulatorView]) { if (self.primaryViewController == [pManager getBrowserView]) @@ -748,6 +748,8 @@ void x_init_persistent_path(MyString& hp) return ; } + */ + /* // Gère manuellement la rotation diff --git a/Common.iphone/detailViewController.mm b/Common.iphone/detailViewController.mm index 1d6e742..0c28f05 100644 --- a/Common.iphone/detailViewController.mm +++ b/Common.iphone/detailViewController.mm @@ -114,19 +114,35 @@ } + + // IOS 5 Compatibility - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return YES; + return YES; } -// IOS6 - (BOOL)shouldAutorotate { - return YES; + return YES; } +// IOS 8 +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; +} + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + [coordinator animateAlongsideTransition:^(id context) { +// [self updateView]; + + } completion:^(id context) { + + }]; +} diff --git a/Common.iphone/infoViewController.h b/Common.iphone/infoViewController.h index 41f34db..a5acd11 100644 --- a/Common.iphone/infoViewController.h +++ b/Common.iphone/infoViewController.h @@ -20,7 +20,8 @@ @property (nonatomic, strong) IBOutlet UIView* portraitView; @property (nonatomic, strong) IBOutlet UIView* landscapeView; -- (void)updateView:(UIDeviceOrientation)_orientation ; +//- (void)updateView:(UIDeviceOrientation)_orientation ; +- (void)updateView ; - (IBAction) doneButton:(id)_sender; - (IBAction) parametersButton:(id)_sender; - (IBAction) emailButton:(id)_sender; diff --git a/Common.iphone/infoViewController.mm b/Common.iphone/infoViewController.mm index 33c502c..3bda18a 100644 --- a/Common.iphone/infoViewController.mm +++ b/Common.iphone/infoViewController.mm @@ -55,8 +55,14 @@ } +/* +-(void)updateView:(UIDeviceOrientation)_orientation +{ + +} +*/ --(void)updateView:(UIDeviceOrientation)_orientation +-(void)updateView { debug_printf("updateView infoViewController"); @@ -68,26 +74,8 @@ else self.view = self.landscapeView; -// self.view = self.portraitView; - + self.view = self.portraitView; - CGAffineTransform matv = CGAffineTransformIdentity; - matv = CGAffineTransformRotate (matv,(270-[pManager getAngle])*M_PI/180); //Avec - self.view.transform = matv; - - CGRect rv2 = [[UIScreen mainScreen] applicationFrame]; - CGRect rv3 = CGRectApplyAffineTransform(rv2,matv); - rv3.origin.x = 0; - rv3.origin.y = 0; - [self.view setBounds:rv3]; - - CGRect rscreen = [[UIScreen mainScreen] applicationFrame]; - CGRect vscreen = self.view.frame; - - vscreen.origin.x = (rscreen.size.width - self.view.frame.size.width)/2; - vscreen.origin.y = (rscreen.size.height-self.view.frame.size.height)/2; - [self.view setFrame:vscreen]; - // pour réactiver les gestures [self viewDidAppear:FALSE]; @@ -134,12 +122,28 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return NO; + return YES; } - (BOOL)shouldAutorotate { - return NO; + return YES; +} + +// IOS 8 +- (NSUInteger)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; +} + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator +{ + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + [coordinator animateAlongsideTransition:^(id context) { + [self updateView]; + + } completion:^(id context) { + + }]; } @end