@@ -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 ;
@@ -39,6 +38,9 @@ Licensed to the Apache Software Foundation (ASF) under one
3938import android .view .WindowManager ;
4039import android .view .animation .AccelerateInterpolator ;
4140import android .view .animation .AlphaAnimation ;
41+ import android .content .DialogInterface ;
42+ import java .util .List ;
43+ import java .util .function .Consumer ;
4244import android .view .animation .Animation ;
4345import android .view .animation .DecelerateInterpolator ;
4446import android .widget .ImageView ;
@@ -54,8 +56,6 @@ Licensed to the Apache Software Foundation (ASF) under one
5456import org .json .JSONException ;
5557
5658import java .util .ArrayList ;
57- import java .util .List ;
58- import java .util .function .Consumer ;
5959
6060@ SuppressLint ("LongLogTag" )
6161public class SplashScreenPlugin extends CordovaPlugin {
@@ -95,6 +95,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
9595 */
9696 private int fadeDuration ;
9797
98+ private static boolean hasCustomSplashscreens ;
99+
98100 // Internal variables
99101 /**
100102 * Boolean flag to determine if the splash screen remains visible.
@@ -125,7 +127,7 @@ protected void pluginInitialize() {
125127
126128 Context context = cordova .getContext ();
127129 boolean showSpinner = preferences .getBoolean ("ShowSplashScreenSpinner" , DEFAULT_SHOW_SPINNER );
128- boolean hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
130+ hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
129131 if (!showSpinner && !hasCustomSplashscreens ) {
130132 // Use only the Android Splashscreen API
131133 behaviours .registerBehaviour (new AndroidSplashScreenBehaviour (context , autoHide , delayTime , isFadeEnabled , fadeDuration , webView ));
@@ -329,7 +331,9 @@ public void onAnimationEnd(Animator animation) {
329331 }
330332 });
331333 } else {
332- cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
334+ if (!hasCustomSplashscreens ){
335+ cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
336+ }
333337 }
334338
335339 }
0 commit comments