You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/10/01 02:52:06 UTC

git commit: CB-7633 - Add support for iPhone 6/6+

Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 0ffe1c2d4 -> 55722de1c


CB-7633 - Add support for iPhone 6/6+


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

Branch: refs/heads/master
Commit: 55722de1c413a8f52cebc31567df0054dc968aa9
Parents: 0ffe1c2
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue Sep 30 17:52:30 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Sep 30 17:52:30 2014 -0700

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/55722de1/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index 0846c55..91fb251 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -148,6 +148,7 @@
     // Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape
     BOOL supportsLandscape = (supportedOrientations & UIInterfaceOrientationMaskLandscape);
     BOOL supportsPortrait = (supportedOrientations & UIInterfaceOrientationMaskPortrait || supportedOrientations & UIInterfaceOrientationMaskPortraitUpsideDown);
+    // this means there are no mixed orientations in there
     BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape);
     
     if (imageName) {
@@ -156,9 +157,24 @@
         imageName = @"Default";
     }
     
-    if (device.iPhone5) {
+    if (device.iPhone5) { // does not support landscape
         imageName = [imageName stringByAppendingString:@"-568h"];
-    } else if (device.iPad) {
+    } else if (device.iPhone6) { // does not support landscape
+        imageName = [imageName stringByAppendingString:@"-667h"];
+    } else if (device.iPhone6Plus) { // supports landscape
+        switch (currentOrientation) {
+            case UIInterfaceOrientationLandscapeLeft:
+            case UIInterfaceOrientationLandscapeRight:
+                if (supportsLandscape) {
+                    imageName = [imageName stringByAppendingString:@"-Landscape"];
+                }
+                break;
+            default:
+                break;
+        }
+        imageName = [imageName stringByAppendingString:@"-736h"];
+
+    } else if (device.iPad) { // supports landscape
         if (isOrientationLocked) {
             imageName = [imageName stringByAppendingString:(supportsLandscape ? @"-Landscape" : @"-Portrait")];
         } else {