CB-8345 android: Make "splash" the default resource ID instead of null

This commit is contained in:
Andrew Grieve 2015-03-24 14:49:20 -04:00
parent 0ff8d52081
commit 1d89a2aa1b

View File

@ -61,10 +61,10 @@ public class SplashScreen extends CordovaPlugin {
return; return;
} }
// Make WebView invisible while loading URL // Make WebView invisible while loading URL
getView().setVisibility(View.INVISIBLE); // getView().setVisibility(View.INVISIBLE);
int drawableId = preferences.getInteger("SplashDrawableId", 0); int drawableId = preferences.getInteger("SplashDrawableId", 0);
if (drawableId == 0) { if (drawableId == 0) {
String splashResource = preferences.getString("SplashScreen", null); String splashResource = preferences.getString("SplashScreen", "splash");
if (splashResource != null) { if (splashResource != null) {
drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName()); drawableId = cordova.getActivity().getResources().getIdentifier(splashResource, "drawable", cordova.getActivity().getClass().getPackage().getName());
if (drawableId == 0) { if (drawableId == 0) {
@ -191,7 +191,7 @@ public class SplashScreen extends CordovaPlugin {
root.setMinimumWidth(display.getWidth()); root.setMinimumWidth(display.getWidth());
root.setOrientation(LinearLayout.VERTICAL); root.setOrientation(LinearLayout.VERTICAL);
// TODO: Use the background color of the webview's parent instead of using the // TODO: Use the background color of the webView's parent instead of using the
// preference. // preference.
root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK)); root.setBackgroundColor(preferences.getInteger("backgroundColor", Color.BLACK));
root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, root.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
@ -258,12 +258,12 @@ public class SplashScreen extends CordovaPlugin {
cordova.getActivity().runOnUiThread(new Runnable() { cordova.getActivity().runOnUiThread(new Runnable() {
public void run() { public void run() {
spinnerStop(); spinnerStop();
spinnerDialog = ProgressDialog.show(webView.getContext(), title, message, true, true, /*spinnerDialog = ProgressDialog.show(webView.getContext(), title, message, true, true,
new DialogInterface.OnCancelListener() { new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
spinnerDialog = null; spinnerDialog = null;
} }
}); });*/
} }
}); });
} }