mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-04 00:02:03 +08:00
CB-779: Verify that fullscreen and backgroundColor preferences are set properly - This check-in enables background color and adds test for it.
This commit is contained in:
@@ -330,10 +330,8 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
this.init();
|
||||
}
|
||||
|
||||
// TODO @bc - background color doesn't work
|
||||
// If backgroundColor
|
||||
// Set backgroundColor
|
||||
this.backgroundColor = this.getIntegerProperty("backgroundColor", Color.BLACK);
|
||||
LOG.e(TAG, "Setting background color=" + this.backgroundColor);
|
||||
this.root.setBackgroundColor(this.backgroundColor);
|
||||
|
||||
// If keepRunning
|
||||
@@ -457,7 +455,18 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
if (bundle == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
Boolean p = (Boolean) bundle.get(name);
|
||||
Boolean p;
|
||||
try {
|
||||
p = (Boolean) bundle.get(name);
|
||||
} catch (ClassCastException e) {
|
||||
String s = bundle.get(name).toString();
|
||||
if ("true".equals(s)) {
|
||||
p = true;
|
||||
}
|
||||
else {
|
||||
p = false;
|
||||
}
|
||||
}
|
||||
if (p == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -476,7 +485,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
if (bundle == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
Integer p = (Integer) bundle.get(name);
|
||||
Integer p;
|
||||
try {
|
||||
p = (Integer) bundle.get(name);
|
||||
} catch (ClassCastException e) {
|
||||
p = Integer.parseInt(bundle.get(name).toString());
|
||||
}
|
||||
if (p == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -514,7 +528,12 @@ public class DroidGap extends Activity implements CordovaInterface {
|
||||
if (bundle == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
Double p = (Double) bundle.get(name);
|
||||
Double p;
|
||||
try {
|
||||
p = (Double) bundle.get(name);
|
||||
} catch (ClassCastException e) {
|
||||
p = Double.parseDouble(bundle.get(name).toString());
|
||||
}
|
||||
if (p == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user