@@ -50,12 +50,14 @@ Licensed to the Apache Software Foundation (ASF) under one
5050import androidx .core .splashscreen .SplashScreen ;
5151import androidx .core .splashscreen .SplashScreenViewProvider ;
5252
53+ import java .util .ArrayList ;
54+ import java .util .List ;
55+ import java .util .function .Consumer ;
56+
5357import org .json .JSONArray ;
5458import org .json .JSONException ;
5559
5660import java .util .ArrayList ;
57- import java .util .List ;
58- import java .util .function .Consumer ;
5961
6062@ SuppressLint ("LongLogTag" )
6163public class SplashScreenPlugin extends CordovaPlugin {
@@ -95,6 +97,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
9597 */
9698 private int fadeDuration ;
9799
100+ private static boolean hasCustomSplashscreens ;
101+
98102 // Internal variables
99103 /**
100104 * Boolean flag to determine if the splash screen remains visible.
@@ -125,7 +129,7 @@ protected void pluginInitialize() {
125129
126130 Context context = cordova .getContext ();
127131 boolean showSpinner = preferences .getBoolean ("ShowSplashScreenSpinner" , DEFAULT_SHOW_SPINNER );
128- boolean hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
132+ hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
129133 if (!showSpinner && !hasCustomSplashscreens ) {
130134 // Use only the Android Splashscreen API
131135 behaviours .registerBehaviour (new AndroidSplashScreenBehaviour (context , autoHide , delayTime , isFadeEnabled , fadeDuration , webView ));
@@ -329,7 +333,9 @@ public void onAnimationEnd(Animator animation) {
329333 }
330334 });
331335 } else {
332- cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
336+ if (!hasCustomSplashscreens ){
337+ cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
338+ }
333339 }
334340
335341 }
0 commit comments