@@ -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 ;
@@ -36,7 +35,6 @@ Licensed to the Apache Software Foundation (ASF) under one
3635import android .view .Gravity ;
3736import android .view .View ;
3837import android .view .ViewGroup .LayoutParams ;
39- import android .view .WindowManager ;
4038import android .view .animation .AccelerateInterpolator ;
4139import android .view .animation .AlphaAnimation ;
4240import android .view .animation .Animation ;
@@ -54,8 +52,6 @@ Licensed to the Apache Software Foundation (ASF) under one
5452import org .json .JSONException ;
5553
5654import java .util .ArrayList ;
57- import java .util .List ;
58- import java .util .function .Consumer ;
5955
6056@ SuppressLint ("LongLogTag" )
6157public class SplashScreenPlugin extends CordovaPlugin {
@@ -95,6 +91,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
9591 */
9692 private int fadeDuration ;
9793
94+ private static boolean hasCustomSplashscreens ;
95+
9896 // Internal variables
9997 /**
10098 * Boolean flag to determine if the splash screen remains visible.
@@ -125,7 +123,7 @@ protected void pluginInitialize() {
125123
126124 Context context = cordova .getContext ();
127125 boolean showSpinner = preferences .getBoolean ("ShowSplashScreenSpinner" , DEFAULT_SHOW_SPINNER );
128- boolean hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
126+ hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
129127 if (!showSpinner && !hasCustomSplashscreens ) {
130128 // Use only the Android Splashscreen API
131129 behaviours .registerBehaviour (new AndroidSplashScreenBehaviour (context , autoHide , delayTime , isFadeEnabled , fadeDuration , webView ));
@@ -329,7 +327,9 @@ public void onAnimationEnd(Animator animation) {
329327 }
330328 });
331329 } else {
332- cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
330+ if (!hasCustomSplashscreens ){
331+ cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
332+ }
333333 }
334334
335335 }
0 commit comments