Skip to content

Commit

Permalink
CB-10412 AutoHideSplashScreen "false" isn't taken in account on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
daserge committed Jan 27, 2016
1 parent 799b0a1 commit 109c82b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/ios/CDVSplashScreen.m
Expand Up @@ -388,6 +388,19 @@ - (void)setVisible:(BOOL)visible
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";
Expand Down Expand Up @@ -418,7 +431,14 @@ - (void)setVisible:(BOOL)visible
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)
Expand Down

0 comments on commit 109c82b

Please sign in to comment.