summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-07-15 11:13:48 -0700
committerJohn Reck <jreck@google.com>2011-07-15 11:33:12 -0700
commit2fd9d0e1db6c2f3bb364f651ef3b32189b7ef77d (patch)
tree5d78607eeddc93e6c0efd249ab4e80d9ba969dd7
parent7ab75ee486cd0e316dda66d2c6a73b0de1f16332 (diff)
downloadpackages_apps_Browser-2fd9d0e1db6c2f3bb364f651ef3b32189b7ef77d.zip
packages_apps_Browser-2fd9d0e1db6c2f3bb364f651ef3b32189b7ef77d.tar.gz
packages_apps_Browser-2fd9d0e1db6c2f3bb364f651ef3b32189b7ef77d.tar.bz2
Inverted lab preference
Change-Id: I28636302e00a23ee65e2c63e5ebe4bebdc4576c4
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/xml-sw600dp/lab_preferences.xml8
-rw-r--r--res/xml/lab_preferences.xml5
-rw-r--r--src/com/android/browser/BrowserSettings.java7
-rw-r--r--src/com/android/browser/PreferenceKeys.java1
5 files changed, 22 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d7f2934..a5d40e4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -642,6 +642,10 @@
<!-- Summary for the fullscreen lab feature [CHAR LIMIT=120] -->
<string name="pref_lab_fullscreen_summary">
Use fullscreen mode to hide the status bar.</string>
+ <!-- Title for the inverted screen lab feature. This causes the screen to render with inverted colors (black becomes white and vice versa) [CHAR LIMIT=40] -->
+ <string name="pref_lab_inverted">Inverted Rendering</string>
+ <!-- Summary for the inverted screen lab feature. [CHAR LIMIT=120] -->
+ <string name="pref_lab_inverted_summary">Checking this causes the browser to invert colors. Black will become white and vice versa.</string>
<!-- Title for bandwidth management preference [CHAR LIMIT=25] -->
<string name="pref_data_title">Bandwidth Management</string>
<!-- Title for search preloading [CHAR LIMIT=40] -->
diff --git a/res/xml-sw600dp/lab_preferences.xml b/res/xml-sw600dp/lab_preferences.xml
index 1dbec88..512c8c1 100644
--- a/res/xml-sw600dp/lab_preferences.xml
+++ b/res/xml-sw600dp/lab_preferences.xml
@@ -16,17 +16,19 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" >
-
<CheckBoxPreference
android:key="enable_quick_controls"
android:defaultValue="false"
android:title="@string/pref_lab_quick_controls"
android:summary="@string/pref_lab_quick_controls_summary" />
-
<CheckBoxPreference
android:key="use_instant_search"
android:defaultValue="false"
android:title="@string/pref_use_instant_search"
android:summary="@string/pref_use_instant_search_summary" />
-
+ <CheckBoxPreference
+ android:key="inverted"
+ android:defaultValue="false"
+ android:title="@string/pref_lab_inverted"
+ android:summary="@string/pref_lab_inverted_summary" />
</PreferenceScreen>
diff --git a/res/xml/lab_preferences.xml b/res/xml/lab_preferences.xml
index 3320cee..a3de6ca 100644
--- a/res/xml/lab_preferences.xml
+++ b/res/xml/lab_preferences.xml
@@ -26,4 +26,9 @@
android:defaultValue="false"
android:title="@string/pref_lab_fullscreen"
android:summary="@string/pref_lab_fullscreen_summary" />
+ <CheckBoxPreference
+ android:key="inverted"
+ android:defaultValue="false"
+ android:title="@string/pref_lab_inverted"
+ android:summary="@string/pref_lab_inverted_summary" />
</PreferenceScreen>
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 4d41426..dcc3269 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -205,6 +205,9 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
} else {
settings.setUserAgentString(USER_AGENTS[getUserAgent()]);
}
+
+ settings.setProperty("gfxInvertedScreen",
+ useInvertedRendering() ? "true" : "false");
}
/**
@@ -674,6 +677,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
return mPrefs.getBoolean(PREF_FULLSCREEN, false);
}
+ public boolean useInvertedRendering() {
+ return mPrefs.getBoolean(PREF_INVERTED, false);
+ }
+
// -----------------------------
// getter/setters for privacy_security_preferences.xml
// -----------------------------
diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java
index 08ee91f..4174732 100644
--- a/src/com/android/browser/PreferenceKeys.java
+++ b/src/com/android/browser/PreferenceKeys.java
@@ -77,6 +77,7 @@ public interface PreferenceKeys {
static final String PREF_ENABLE_QUICK_CONTROLS = "enable_quick_controls";
static final String PREF_USE_INSTANT_SEARCH = "use_instant_search";
static final String PREF_FULLSCREEN = "fullscreen";
+ static final String PREF_INVERTED = "inverted";
// ----------------------
// Keys for privacy_security_preferences.xml