diff --git a/ActiveGS_iOS/activegs.plist b/ActiveGS_iOS/activegs.plist index 451eb6c..bd87999 100644 --- a/ActiveGS_iOS/activegs.plist +++ b/ActiveGS_iOS/activegs.plist @@ -40,6 +40,13 @@ UIStatusBarHidden~ipad + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIViewControllerBasedStatusBarAppearance diff --git a/Common.iphone/activegsAppDelegate.mm b/Common.iphone/activegsAppDelegate.mm index 51e5ec9..42cfbd6 100644 --- a/Common.iphone/activegsAppDelegate.mm +++ b/Common.iphone/activegsAppDelegate.mm @@ -689,7 +689,8 @@ void x_init_persistent_path(MyString& hp) - (void) didRotate:(NSNotification *)notification { - + + UIViewController *v = self.primaryViewController; if (v==nil) return ; @@ -747,7 +748,8 @@ void x_init_persistent_path(MyString& hp) return ; } - + +/* // Gère manuellement la rotation // Mets les interfaces systèmes (UIAlert) dans le bon mode @@ -764,21 +766,15 @@ void x_init_persistent_path(MyString& hp) // if (currentRawReading==270) [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationPortrait]; - - - // Recalcule la zone d'affichage de l'émulateur - +*/ + // enleve le clavier si une rotation a eu lieu if (oldRotate != self.currentRawReading )//&& [self hasSecondary]==false) { - [[pManager getEmulatorView].kbdc restoreInput]; - - //[[pManager getEmulatorView].kbdc hideInput]; - // [[pManager getEmulatorView].kbdc enableKeyboard:FALSE]; } - [[pManager getEmulatorView] updateView ]; +// [[pManager getEmulatorView] updateView ]; } diff --git a/Common.iphone/activegsEmulatorController.mm b/Common.iphone/activegsEmulatorController.mm index 40cbead..5dcf138 100644 --- a/Common.iphone/activegsEmulatorController.mm +++ b/Common.iphone/activegsEmulatorController.mm @@ -467,7 +467,7 @@ int x_lock_zoom = 0; [UIView setAnimationDuration:0.3]; CGAffineTransform matv = CGAffineTransformIdentity; - matv = CGAffineTransformRotate (matv,(270-[pManager getAngle])*M_PI/180); //Avec +// matv = CGAffineTransformRotate (matv,(270-[pManager getAngle])*M_PI/180); //Avec self.contentView.transform = matv; @@ -560,7 +560,6 @@ int x_lock_zoom = 0; boundRect.origin.y = 0; } - [self.contentView setBounds:boundRect]; } @@ -576,12 +575,7 @@ int x_lock_zoom = 0; // l'interface est repositionnées mais non animée - CGRect uirect = [[UIScreen mainScreen] applicationFrame]; - CGRect uirectrotate = CGRectApplyAffineTransform(uirect,matv); - - uirectrotate.origin.x = 0; - uirectrotate.origin.y = 0; - + CGRect uirectrotate = [[UIScreen mainScreen] applicationFrame]; [self.kbdc updateView:uirectrotate]; [pManager updateNotificationView:uirectrotate]; @@ -593,14 +587,31 @@ int x_lock_zoom = 0; - (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) { + + }]; +} + + - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. diff --git a/Common.iphone/activegsViewController.mm b/Common.iphone/activegsViewController.mm index f855f7f..48ee2af 100644 --- a/Common.iphone/activegsViewController.mm +++ b/Common.iphone/activegsViewController.mm @@ -382,6 +382,21 @@ 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