cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-plugin-splashscreen git commit: CB-8988: Fix rotation on iOS/iPad (closes #46)
Date Tue, 12 May 2015 00:48:43 GMT
Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 6cc3d1f3f -> 87f3c3a3a


CB-8988: Fix rotation on iOS/iPad (closes #46)

The viewController.interfaceOrientation passed to getImageName has not
yet been updated with the new orientation, even when the frame/bounds
change event has fired. Thus, the plugin never actually loads the
correct image for the new orientation. Instead, it poorly scales the
existing image.

This fix uses the statusBarOrientation property of the UIApplication
object to detect the actual orientation, and correctly load the right
image.

Signed-off-by: Shazron Abdullah <shazron@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/87f3c3a3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/87f3c3a3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/87f3c3a3

Branch: refs/heads/master
Commit: 87f3c3a3ac2c7c39f74f1173109377e87bd35078
Parents: 6cc3d1f
Author: Dan Polivy <dan@cellartracker.com>
Authored: Thu May 7 16:37:02 2015 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Mon May 11 17:46:58 2015 -0700

----------------------------------------------------------------------
 src/ios/CDVSplashScreen.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/87f3c3a3/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index 3c0294b..8636cb5 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -204,7 +204,7 @@
 // Sets the view's frame and image.
 - (void)updateImage
 {
-    NSString* imageName = [self getImageName:self.viewController.interfaceOrientation delegate:(id<CDVScreenOrientationDelegate>)self.viewController
device:[self getCurrentDevice]];
+    NSString* imageName = [self getImageName:[[UIApplication sharedApplication] statusBarOrientation]
delegate:(id<CDVScreenOrientationDelegate>)self.viewController device:[self getCurrentDevice]];
 
     if (![imageName isEqualToString:_curImageName]) {
         UIImage* img = [UIImage imageNamed:imageName];


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


Mime
View raw message