@@ -26,7 +26,6 @@ Licensed to the Apache Software Foundation (ASF) under one
2626import android .app .Dialog ;
2727import android .app .ProgressDialog ;
2828import android .content .Context ;
29- import android .content .DialogInterface ;
3029import android .content .res .ColorStateList ;
3130import android .content .res .Configuration ;
3231import android .graphics .Color ;
@@ -54,8 +53,6 @@ Licensed to the Apache Software Foundation (ASF) under one
5453import org .json .JSONException ;
5554
5655import java .util .ArrayList ;
57- import java .util .List ;
58- import java .util .function .Consumer ;
5956
6057@ SuppressLint ("LongLogTag" )
6158public class SplashScreenPlugin extends CordovaPlugin {
@@ -95,6 +92,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
9592 */
9693 private int fadeDuration ;
9794
95+ private static boolean hasCustomSplashscreens ;
96+
9897 // Internal variables
9998 /**
10099 * Boolean flag to determine if the splash screen remains visible.
@@ -125,7 +124,7 @@ protected void pluginInitialize() {
125124
126125 Context context = cordova .getContext ();
127126 boolean showSpinner = preferences .getBoolean ("ShowSplashScreenSpinner" , DEFAULT_SHOW_SPINNER );
128- boolean hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
127+ hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
129128 if (!showSpinner && !hasCustomSplashscreens ) {
130129 // Use only the Android Splashscreen API
131130 behaviours .registerBehaviour (new AndroidSplashScreenBehaviour (context , autoHide , delayTime , isFadeEnabled , fadeDuration , webView ));
@@ -329,7 +328,9 @@ public void onAnimationEnd(Animator animation) {
329328 }
330329 });
331330 } else {
332- cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
331+ if (!hasCustomSplashscreens ){
332+ cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
333+ }
333334 }
334335
335336 }
0 commit comments