cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject ios commit: CB-2436 Wrong splashscreen is displayed when UILaunchImageFile is set
Date Thu, 07 Mar 2013 17:46:37 GMT
Updated Branches:
  refs/heads/master 1c88d9f58 -> 942d33c8e


CB-2436 Wrong splashscreen is displayed when UILaunchImageFile is set

-correct splash shown for iPhone and iPad (all models)


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/942d33c8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/942d33c8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/942d33c8

Branch: refs/heads/master
Commit: 942d33c8e7174a5766029ea1232ba2e0df745c3f
Parents: 1c88d9f
Author: James Jong <wjamesjong@gmail.com>
Authored: Tue Mar 5 15:13:44 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Mar 7 09:45:03 2013 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVSplashScreen.m |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/942d33c8/CordovaLib/Classes/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVSplashScreen.m b/CordovaLib/Classes/CDVSplashScreen.m
index 2c55461..8778094 100644
--- a/CordovaLib/Classes/CDVSplashScreen.m
+++ b/CordovaLib/Classes/CDVSplashScreen.m
@@ -112,19 +112,30 @@
 - (void)updateImage
 {
     UIInterfaceOrientation orientation = self.viewController.interfaceOrientation;
-    // IPHONE (default)
-    NSString* imageName = @"Default";
+
+    // Use UILaunchImageFile if specified in plist.  Otherwise, use Default.
+    NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"];
+
+    if (imageName) {
+        imageName = [imageName stringByDeletingPathExtension];
+    } else {
+        imageName = @"Default";
+    }
 
     if (CDV_IsIPhone5()) {
         imageName = [imageName stringByAppendingString:@"-568h"];
     } else if (CDV_IsIPad()) {
-        // set default to portrait upside down
-        imageName = @"Default-Portrait"; // @"Default-PortraitUpsideDown.png";
-
-        if (orientation == UIInterfaceOrientationLandscapeLeft) {
-            imageName = @"Default-Landscape.png"; // @"Default-LandscapeLeft.png";
-        } else if (orientation == UIInterfaceOrientationLandscapeRight) {
-            imageName = @"Default-Landscape.png"; // @"Default-LandscapeRight.png";
+        switch (orientation) {
+            case UIInterfaceOrientationLandscapeLeft:
+            case UIInterfaceOrientationLandscapeRight:
+                imageName = [imageName stringByAppendingString:@"-Landscape"];
+                break;
+
+            case UIInterfaceOrientationPortrait:
+            case UIInterfaceOrientationPortraitUpsideDown:
+            default:
+                imageName = [imageName stringByAppendingString:@"-Portrait"];
+                break;
         }
     }
 


Mime
View raw message