forked from github/cordova-android
fix: only do fadeout animation if FadeSplashScreen is true (#1506)
This commit is contained in:
parent
80f232aa79
commit
56d4b8312b
@ -137,6 +137,7 @@ public class SplashScreenPlugin extends CordovaPlugin {
|
||||
// If auto hide is disabled (false), the hiding of the splash screen must be determined &
|
||||
// triggered by the front-end code with the `navigator.splashscreen.hide()` method.
|
||||
|
||||
if (isFadeEnabled) {
|
||||
// Setup the fade
|
||||
splashScreen.setOnExitAnimationListener(new SplashScreen.OnExitAnimationListener() {
|
||||
@Override
|
||||
@ -146,8 +147,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
|
||||
splashScreenView
|
||||
.animate()
|
||||
.alpha(0.0f)
|
||||
.setDuration(isFadeEnabled ? fadeDuration : 0)
|
||||
.setStartDelay(isFadeEnabled ? 0 : fadeDuration)
|
||||
.setDuration(fadeDuration)
|
||||
.setStartDelay(0)
|
||||
.setInterpolator(new AccelerateInterpolator())
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@ -159,6 +160,7 @@ public class SplashScreenPlugin extends CordovaPlugin {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void attemptCloseOnPageFinished() {
|
||||
if (autoHide && delayTime == DEFAULT_DELAY_TIME) {
|
||||
|
Loading…
Reference in New Issue
Block a user