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/25 12:08:08 UTC

[1/2] cordova-plugin-splashscreen git commit: CB-9043 Fix the ios splashscreen being deformed on orientation change

Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master ccb3c2f45 -> fa3b66522


CB-9043 Fix the ios splashscreen being deformed on orientation change


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

Branch: refs/heads/master
Commit: 875ccbf5bcacc10918f712d6b3455694381b2a2e
Parents: ccb3c2f
Author: daserge <v-...@microsoft.com>
Authored: Tue Dec 22 17:15:59 2015 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Dec 22 17:15:59 2015 +0300

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/875ccbf5/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index c1c109a..711688b 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -244,10 +244,47 @@
     return imageName;
 }
 
+- (UIInterfaceOrientation)getCurrentOrientation
+{
+    UIInterfaceOrientation iOrientation = [UIApplication sharedApplication].statusBarOrientation;
+    UIDeviceOrientation dOrientation = [UIDevice currentDevice].orientation;
+
+    bool landscape;
+
+    if (dOrientation == UIDeviceOrientationUnknown || dOrientation == UIDeviceOrientationFaceUp || dOrientation == UIDeviceOrientationFaceDown) {
+        // If the device is laying down, use the UIInterfaceOrientation based on the status bar.
+        landscape = UIInterfaceOrientationIsLandscape(iOrientation);
+    } else {
+        // If the device is not laying down, use UIDeviceOrientation.
+        landscape = UIDeviceOrientationIsLandscape(dOrientation);
+
+        // There's a bug in iOS!!!! http://openradar.appspot.com/7216046
+        // So values needs to be reversed for landscape!
+        if (dOrientation == UIDeviceOrientationLandscapeLeft)
+        {
+            iOrientation = UIInterfaceOrientationLandscapeRight;
+        }
+        else if (dOrientation == UIDeviceOrientationLandscapeRight)
+        {
+            iOrientation = UIInterfaceOrientationLandscapeLeft;
+        }
+        else if (dOrientation == UIDeviceOrientationPortrait)
+        {
+            iOrientation = UIInterfaceOrientationPortrait;
+        }
+        else if (dOrientation == UIDeviceOrientationPortraitUpsideDown)
+        {
+            iOrientation = UIInterfaceOrientationPortraitUpsideDown;
+        }
+    }
+
+    return iOrientation;
+}
+
 // Sets the view's frame and image.
 - (void)updateImage
 {
-    NSString* imageName = [self getImageName:[[UIApplication sharedApplication] statusBarOrientation] delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]];
+    NSString* imageName = [self getImageName:[self getCurrentOrientation] delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]];
 
     if (![imageName isEqualToString:_curImageName])
     {


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


[2/2] cordova-plugin-splashscreen git commit: CB-10244 Don't rotate the iPhone 6 Plus splash

Posted by da...@apache.org.
CB-10244 Don't rotate the iPhone 6 Plus splash


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

Branch: refs/heads/master
Commit: fa3b6652238faf6854157b6e646069eb35bb55a5
Parents: 875ccbf
Author: daserge <v-...@microsoft.com>
Authored: Tue Dec 22 17:28:53 2015 +0300
Committer: daserge <v-...@microsoft.com>
Committed: Tue Dec 22 17:28:53 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/fa3b6652/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index 711688b..b34a926 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -318,8 +318,8 @@
      * landscape. In this case the image must be rotated in order to appear
      * correctly.
      */
-    BOOL isIPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
-    if (UIInterfaceOrientationIsLandscape(orientation) && !isIPad)
+    CDV_iOSDevice device = [self getCurrentDevice];
+    if (UIInterfaceOrientationIsLandscape(orientation) && !device.iPhone6Plus && !device.iPad)
     {
         imgTransform = CGAffineTransformMakeRotation(M_PI / 2);
         imgBounds.size = CGSizeMake(imgBounds.size.height, imgBounds.size.width);


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