You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2022/10/27 21:38:36 UTC
[cordova-android] branch master updated: fix: only do fadeout animation if FadeSplashScreen is true (#1506)
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 <jc...@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-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org