You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/06/27 20:58:50 UTC

git commit: CB-7041 ios: Fix image filename logic when setting the iPad splash screen

Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 6f23d8e82 -> cd61952ef


CB-7041 ios: Fix image filename logic when setting the iPad splash screen

When running Cordova apps without orientation lock on iPads, the
Splash Screen plugin didn't work properly. It would skip the iPad-
specific splash screen logic, and just select the image named
@"Default.png" (without adding the orientation suffix), and print
the following messages in the console:

WARNING: The splashscreen image named Default was not found

Now, for iPads, the splash screen image is set by first looking
at the position of the orientation lock, and if that is not set, it
uses the calculated view orientation.

close #19


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/cd61952e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/cd61952e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/cd61952e

Branch: refs/heads/master
Commit: cd61952efc68365138115cb1d5fbefa0695198d1
Parents: 6f23d8e
Author: Michael Hoisie <ho...@meraki.com>
Authored: Tue Jun 10 22:40:11 2014 -0700
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jun 27 14:56:49 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/cd61952e/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index fdfc4c4..7ce828d 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -138,18 +138,22 @@
 
     if (CDV_IsIPhone5()) {
         imageName = [imageName stringByAppendingString:@"-568h"];
-    } else if (CDV_IsIPad() && isOrientationLocked) {
-        switch (orientation) {
-            case UIInterfaceOrientationLandscapeLeft:
-            case UIInterfaceOrientationLandscapeRight:
-                imageName = [imageName stringByAppendingString:@"-Landscape"];
-                break;
-
-            case UIInterfaceOrientationPortrait:
-            case UIInterfaceOrientationPortraitUpsideDown:
-            default:
-                imageName = [imageName stringByAppendingString:@"-Portrait"];
-                break;
+    } else if (CDV_IsIPad()) {
+        if (isOrientationLocked) {
+            imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")];
+        } else {
+            switch (orientation) {
+                case UIInterfaceOrientationLandscapeLeft:
+                case UIInterfaceOrientationLandscapeRight:
+                    imageName = [imageName stringByAppendingString:@"-Landscape"];
+                    break;
+
+                case UIInterfaceOrientationPortrait:
+                case UIInterfaceOrientationPortraitUpsideDown:
+                default:
+                    imageName = [imageName stringByAppendingString:@"-Portrait"];
+                    break;
+            }
         }
     }