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/14 01:06:45 UTC

[1/2] git commit: Fix for portrait/landscape detection

Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 887f0f6c8 -> c67622f1b


Fix for portrait/landscape detection

Sometimes the width can be 568 or 320 depending on orientation on iPhone 5. This fixes the detection.

Signed-off-by: Shazron Abdullah <sh...@apache.org>


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

Branch: refs/heads/master
Commit: 2f37eed1840619c31f5fdc746cbf9324ef6afb53
Parents: 887f0f6
Author: Nic Mulvaney <ni...@nicmulvaney.com>
Authored: Sat Oct 11 18:53:40 2014 +0100
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Oct 13 16:03:33 2014 -0700

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/2f37eed1/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index ade5df0..4b4d466 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -124,16 +124,19 @@
     
     UIScreen* mainScreen = [UIScreen mainScreen];
     CGFloat mainScreenHeight = mainScreen.bounds.size.height;
+    CGFloat mainScreenWidth = mainScreen.bounds.size.width;
+    
+    int limit = MAX(mainScreenHeight,mainScreenWidth);
     
     device.iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
     device.iPhone = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone);
     device.retina = ([mainScreen scale] == 2.0);
-    device.iPhone5 = (device.iPhone && mainScreenHeight == 568.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
     // this is appropriate for detecting the runtime screen environment
-    device.iPhone6 = (device.iPhone && mainScreenHeight == 667.0);
-    device.iPhone6Plus = (device.iPhone && mainScreenHeight == 736.0);
+    device.iPhone6 = (device.iPhone && limit == 667.0);
+    device.iPhone6Plus = (device.iPhone && limit == 736.0);
     
     return device;
 }


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


[2/2] git commit: Update iOS test to specify device

Posted by sh...@apache.org.
Update iOS test to specify device


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

Branch: refs/heads/master
Commit: c67622f1b97a9faa6d96d3c455b5e1a691bbbcbb
Parents: 2f37eed
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Oct 13 16:06:17 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Oct 13 16:06:17 2014 -0700

----------------------------------------------------------------------
 tests/ios/package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/c67622f1/tests/ios/package.json
----------------------------------------------------------------------
diff --git a/tests/ios/package.json b/tests/ios/package.json
index e121e69..ca5db59 100644
--- a/tests/ios/package.json
+++ b/tests/ios/package.json
@@ -8,6 +8,6 @@
         "cordova-ios": "^3.6.0"
     },
     "scripts": {
-        "test": "xcodebuild -scheme CordovaLib && xcodebuild test -scheme CDVSplashScreenLibTests"
+        "test": "xcodebuild -scheme CordovaLib && xcodebuild test -scheme CDVSplashScreenLibTests -destination 'platform=iOS Simulator,name=iPhone 5'"
     }    
 }
\ No newline at end of file


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