You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by da...@apache.org on 2015/12/29 10:04:54 UTC

cordova-plugin-splashscreen git commit: CB-10263 Fix splashscreen plugin filenames for Asset Catalog

Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 1e67606c6 -> d7841c7ec


CB-10263 Fix splashscreen plugin filenames for Asset Catalog

Github: close #69


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

Branch: refs/heads/master
Commit: d7841c7ec9fdf9de83645abdfc9ba6494ad74235
Parents: 1e67606
Author: daserge <v-...@microsoft.com>
Authored: Sat Dec 26 19:43:58 2015 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Dec 29 12:00:31 2015 +0300

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.h |  1 +
 src/ios/CDVSplashScreen.m | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/d7841c7e/src/ios/CDVSplashScreen.h
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.h b/src/ios/CDVSplashScreen.h
index 0d6ae39..4802a30 100644
--- a/src/ios/CDVSplashScreen.h
+++ b/src/ios/CDVSplashScreen.h
@@ -23,6 +23,7 @@
 typedef struct {
     BOOL iPhone;
     BOOL iPad;
+    BOOL iPhone4;
     BOOL iPhone5;
     BOOL iPhone6;
     BOOL iPhone6Plus;

http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/d7841c7e/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index b34a926..3e195b9 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -156,6 +156,7 @@
     device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
     device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
     device.retina = ([mainScreen scale] == 2.0);
+    device.iPhone4 = (device.iPhone && limit == 480.0);
     device.iPhone5 = (device.iPhone && limit == 568.0);
     // note these below is not a true device detect, for example if you are on an
     // iPhone 6/6+ but the app is scaled it will prob set iPhone5 as true, but
@@ -187,7 +188,23 @@
     {
         imageName = @"Default";
     }
-    
+
+    // Add Asset Catalog specific prefixes
+    if ([imageName isEqualToString:@"LaunchImage"])
+    {
+        if (device.iPhone4 || device.iPhone5 || device.iPad) {
+            imageName = [imageName stringByAppendingString:@"-700"];
+        } else if(device.iPhone6) {
+            imageName = [imageName stringByAppendingString:@"-800"];
+        } else if(device.iPhone6Plus) {
+            imageName = [imageName stringByAppendingString:@"-800"];
+            if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown)
+            {
+                imageName = [imageName stringByAppendingString:@"-Portrait"];
+            }
+        }
+    }
+
     if (device.iPhone5)
     { // does not support landscape
         imageName = [imageName stringByAppendingString:@"-568h"];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org