cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dase...@apache.org
Subject cordova-plugin-splashscreen git commit: CB-10412 AutoHideSplashScreen "false" isn't taken in account on iOS
Date Wed, 27 Jan 2016 15:58:07 GMT
Repository: cordova-plugin-splashscreen
Updated Branches:
  refs/heads/master 799b0a173 -> 109c82b29


CB-10412 AutoHideSplashScreen "false" isn't taken in account on iOS


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

Branch: refs/heads/master
Commit: 109c82b29b6cfda4fabcd0aa9a7660954b50e7d6
Parents: 799b0a1
Author: daserge <v-seshak@microsoft.com>
Authored: Tue Jan 26 13:21:42 2016 +0300
Committer: daserge <v-seshak@microsoft.com>
Committed: Wed Jan 27 18:53:23 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/109c82b2/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index 3e195b9..110a0ca 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -388,6 +388,19 @@
         id splashDurationString = [self.commandDelegate.settings objectForKey: [@"SplashScreenDelay"
lowercaseString]];
         float splashDuration = splashDurationString == nil ? kSplashScreenDurationDefault
: [splashDurationString floatValue];
 
+        id autoHideSplashScreenValue = [self.commandDelegate.settings objectForKey:[@"AutoHideSplashScreen"
lowercaseString]];
+        BOOL autoHideSplashScreen = true;
+
+        if (autoHideSplashScreenValue != nil) {
+            autoHideSplashScreen = [autoHideSplashScreenValue boolValue];
+        }
+
+        if (!autoHideSplashScreen) {
+            // CB-10412 SplashScreenDelay does not make sense if the splashscreen is hidden
manually
+            splashDuration = 0;
+        }
+
+
         if (fadeSplashScreenValue == nil)
         {
             fadeSplashScreenValue = @"true";
@@ -418,7 +431,14 @@
         else
         {
             __weak __typeof(self) weakSelf = self;
-            float effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
+            float effectiveSplashDuration;
+
+            if (!autoHideSplashScreen) {
+                effectiveSplashDuration = (fadeDuration) / 1000;
+            } else {
+                effectiveSplashDuration = (splashDuration - fadeDuration) / 1000;
+            }
+
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (uint64_t) effectiveSplashDuration
* NSEC_PER_SEC), dispatch_get_main_queue(), CFBridgingRelease(CFBridgingRetain(^(void) {
                    [UIView transitionWithView:self.viewController.view
                                    duration:(fadeDuration / 1000)


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


Mime
View raw message