CB-8510 CB-7159 Fix background color manual test page not showing flash of green

This commit is contained in:
Andrew Grieve 2015-02-25 12:18:13 -05:00
parent d99856c52b
commit 455298d736
2 changed files with 9 additions and 3 deletions

View File

@ -181,12 +181,13 @@ public class CordovaActivity extends Activity {
LOG.d(TAG, "removing appView from existing parent");
ViewGroup parentGroup = (ViewGroup) parent;
parentGroup.removeView(appView.getView());
if (preferences.contains("BackgroundColor")) {
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
// Background of activity:
appView.getView().setBackgroundColor(backgroundColor);
}
root.addView(appView.getView());
setContentView(root);
int backgroundColor = preferences.getInteger("BackgroundColor", Color.BLACK);
root.setBackgroundColor(backgroundColor);
appView.getView().requestFocusFromTouch();
}

View File

@ -72,6 +72,11 @@ public class CordovaPreferences {
return defaultValue;
}
// Added in 4.0.0
public boolean contains(String name) {
return getString(name, null) != null;
}
public int getInteger(String name, int defaultValue) {
name = name.toLowerCase(Locale.ENGLISH);
String value = prefs.get(name);