CB-8396 Add AutoHideSplashScreen logic to Android's Splashscreen
Also initializing the splashscreen image irrespective of firstShow because the splashscreen could be shown manually via navigator.splashscreen.show(); after exiting the app using BackButton or via navigator.app.exitApp();
This commit is contained in:
parent
eada9a6ac1
commit
7a12204ba9
@ -73,7 +73,7 @@ public class SplashScreen extends CordovaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void pluginInitialize() {
|
protected void pluginInitialize() {
|
||||||
if (HAS_BUILT_IN_SPLASH_SCREEN || !firstShow) {
|
if (HAS_BUILT_IN_SPLASH_SCREEN) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Make WebView invisible while loading URL
|
// Make WebView invisible while loading URL
|
||||||
@ -93,12 +93,15 @@ public class SplashScreen extends CordovaPlugin {
|
|||||||
// Save initial orientation.
|
// Save initial orientation.
|
||||||
orientation = cordova.getActivity().getResources().getConfiguration().orientation;
|
orientation = cordova.getActivity().getResources().getConfiguration().orientation;
|
||||||
|
|
||||||
|
if (firstShow) {
|
||||||
|
boolean autoHide = preferences.getBoolean("AutoHideSplashScreen", true);
|
||||||
|
loadSpinner();
|
||||||
|
showSplashScreen(autoHide);
|
||||||
|
}
|
||||||
|
|
||||||
if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) {
|
if (preferences.getBoolean("SplashShowOnlyFirstTime", true)) {
|
||||||
firstShow = false;
|
firstShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadSpinner();
|
|
||||||
showSplashScreen(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user