You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/02/25 18:26:39 UTC
android commit: CB-8510 CB-7159 Fix background color manual test page
not showing flash of green
Repository: cordova-android
Updated Branches:
refs/heads/master d99856c52 -> 455298d73
CB-8510 CB-7159 Fix background color manual test page not showing flash of green
Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/455298d7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/455298d7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/455298d7
Branch: refs/heads/master
Commit: 455298d736f8db1febde187891c0d86617667c30
Parents: d99856c
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Feb 25 12:18:13 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Feb 25 12:26:11 2015 -0500
----------------------------------------------------------------------
framework/src/org/apache/cordova/CordovaActivity.java | 7 ++++---
framework/src/org/apache/cordova/CordovaPreferences.java | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/455298d7/framework/src/org/apache/cordova/CordovaActivity.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java
index 654f3b9..78af625 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -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();
}
http://git-wip-us.apache.org/repos/asf/cordova-android/blob/455298d7/framework/src/org/apache/cordova/CordovaPreferences.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/CordovaPreferences.java b/framework/src/org/apache/cordova/CordovaPreferences.java
index ed0b9b8..2d13c86 100644
--- a/framework/src/org/apache/cordova/CordovaPreferences.java
+++ b/framework/src/org/apache/cordova/CordovaPreferences.java
@@ -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);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org