This is an automated email from the ASF dual-hosted git repository. jcesarmobile pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push: new 56d4b831 fix: only do fadeout animation if FadeSplashScreen is true (#1506) 56d4b831 is described below commit 56d4b8312bc85253e975da524d9a3c72d7df5418 Author: jcesarmobile <jcesarmob...@gmail.com> AuthorDate: Thu Oct 27 23:38:30 2022 +0200 fix: only do fadeout animation if FadeSplashScreen is true (#1506) --- .../src/org/apache/cordova/SplashScreenPlugin.java | 44 +++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/framework/src/org/apache/cordova/SplashScreenPlugin.java b/framework/src/org/apache/cordova/SplashScreenPlugin.java index 91bcdc70..425b13f9 100644 --- a/framework/src/org/apache/cordova/SplashScreenPlugin.java +++ b/framework/src/org/apache/cordova/SplashScreenPlugin.java @@ -137,27 +137,29 @@ 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. - // Setup the fade - splashScreen.setOnExitAnimationListener(new SplashScreen.OnExitAnimationListener() { - @Override - public void onSplashScreenExit(@NonNull SplashScreenViewProvider splashScreenViewProvider) { - View splashScreenView = splashScreenViewProvider.getView(); - - splashScreenView - .animate() - .alpha(0.0f) - .setDuration(isFadeEnabled ? fadeDuration : 0) - .setStartDelay(isFadeEnabled ? 0 : fadeDuration) - .setInterpolator(new AccelerateInterpolator()) - .setListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - super.onAnimationEnd(animation); - splashScreenViewProvider.remove(); - } - }).start(); - } - }); + if (isFadeEnabled) { + // Setup the fade + splashScreen.setOnExitAnimationListener(new SplashScreen.OnExitAnimationListener() { + @Override + public void onSplashScreenExit(@NonNull SplashScreenViewProvider splashScreenViewProvider) { + View splashScreenView = splashScreenViewProvider.getView(); + + splashScreenView + .animate() + .alpha(0.0f) + .setDuration(fadeDuration) + .setStartDelay(0) + .setInterpolator(new AccelerateInterpolator()) + .setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + splashScreenViewProvider.remove(); + } + }).start(); + } + }); + } } private void attemptCloseOnPageFinished() { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org