From 23c18dc5e0819a168935fcf99139d82ad073b05b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 31 May 2018 15:27:45 +0200 Subject: [PATCH] disable upside down orientation --- Classes/LinphoneAppDelegate.m | 2 +- Classes/PhoneMainView.m | 6 ++++++ linphone-Info.plist | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 69b06678b..aeb4553ad 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -830,7 +830,7 @@ didInvalidatePushTokenForType:(NSString *)type { [[UIDevice currentDevice] setValue:value forKey:@"orientation"]; return UIInterfaceOrientationMaskPortrait; } - else return UIInterfaceOrientationMaskAll; + else return UIInterfaceOrientationMaskAllButUpsideDown; } @end diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 77366626d..860c0599a 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -256,6 +256,9 @@ static RootViewManager *rootViewManagerInstance = nil; - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) + return; + [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; [mainViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; [self orientationUpdate:toInterfaceOrientation]; @@ -263,6 +266,9 @@ static RootViewManager *rootViewManagerInstance = nil; - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) + return; + [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; [mainViewController willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; } diff --git a/linphone-Info.plist b/linphone-Info.plist index 203f036bd..5ca779438 100644 --- a/linphone-Info.plist +++ b/linphone-Info.plist @@ -103,13 +103,11 @@ UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeRight UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationPortrait UIViewControllerBasedStatusBarAppearance