@@ -45,11 +45,9 @@ Licensed to the Apache Software Foundation (ASF) under one
4545import android .widget .LinearLayout ;
4646import android .widget .ProgressBar ;
4747import android .widget .RelativeLayout ;
48-
4948import androidx .annotation .NonNull ;
5049import androidx .core .splashscreen .SplashScreen ;
5150import androidx .core .splashscreen .SplashScreenViewProvider ;
52-
5351import org .json .JSONArray ;
5452import org .json .JSONException ;
5553
@@ -95,6 +93,8 @@ public class SplashScreenPlugin extends CordovaPlugin {
9593 */
9694 private int fadeDuration ;
9795
96+ private static boolean hasCustomSplashscreens ;
97+
9898 // Internal variables
9999 /**
100100 * Boolean flag to determine if the splash screen remains visible.
@@ -125,7 +125,7 @@ protected void pluginInitialize() {
125125
126126 Context context = cordova .getContext ();
127127 boolean showSpinner = preferences .getBoolean ("ShowSplashScreenSpinner" , DEFAULT_SHOW_SPINNER );
128- boolean hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
128+ hasCustomSplashscreens = preferences .getBoolean ("HasCustomSplashscreens" , DEFAULT_HAS_CUSTOM_SPLASHSCREENS );
129129 if (!showSpinner && !hasCustomSplashscreens ) {
130130 // Use only the Android Splashscreen API
131131 behaviours .registerBehaviour (new AndroidSplashScreenBehaviour (context , autoHide , delayTime , isFadeEnabled , fadeDuration , webView ));
@@ -329,7 +329,9 @@ public void onAnimationEnd(Animator animation) {
329329 }
330330 });
331331 } else {
332- cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
332+ if (!hasCustomSplashscreens ){
333+ cordovaWebView .getPluginManager ().postMessage ("updateSystemBars" , null );
334+ }
333335 }
334336
335337 }
0 commit comments