cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [2/7] git commit: CB-4051 fix for splashscreen rotation problem
Date Mon, 10 Feb 2014 23:23:42 GMT
CB-4051 fix for splashscreen rotation problem


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/424e82cd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/424e82cd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/424e82cd

Branch: refs/heads/master
Commit: 424e82cde443bb218b302693c6e899e7c7effcbf
Parents: 1560fc8
Author: Sean Bollin <sean@sean-bollin.com>
Authored: Wed Nov 27 17:14:57 2013 +0900
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Tue Jan 7 14:35:25 2014 -0800

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/424e82cd/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index bba7deb..3b59627 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -18,6 +18,7 @@
  */
 
 #import "CDVSplashScreen.h"
+#import <Cordova/CDVViewController.h>
 
 #define kSplashScreenDurationDefault 0.25f
 
@@ -123,6 +124,12 @@
     // Use UILaunchImageFile if specified in plist.  Otherwise, use Default.
     NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
 
+    // Checks to see if the developer has locked the orientation to use only one of Portrait
or Landscape
+    CDVViewController* vc = (CDVViewController*)self.viewController;
+    BOOL supportsLandscape = [vc supportsOrientation:UIInterfaceOrientationLandscapeLeft]
|| [vc supportsOrientation:UIInterfaceOrientationLandscapeRight];
+    BOOL supportsPortrait = [vc supportsOrientation:UIInterfaceOrientationPortrait] || [vc
supportsOrientation:UIInterfaceOrientationPortraitUpsideDown];
+    BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape);
+
     if (imageName) {
         imageName = [imageName stringByDeletingPathExtension];
     } else {
@@ -131,7 +138,7 @@
 
     if (CDV_IsIPhone5()) {
         imageName = [imageName stringByAppendingString:@"-568h"];
-    } else if (CDV_IsIPad()) {
+    } else if (CDV_IsIPad() || isOrientationLocked) {
         switch (orientation) {
             case UIInterfaceOrientationLandscapeLeft:
             case UIInterfaceOrientationLandscapeRight:


Mime
View raw message