summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/preferences
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-08-03 15:35:34 -0700
committerNicolas Roard <nicolasroard@google.com>2011-08-03 17:16:45 -0700
commit5d513105dff9f453872be40f8bed2391396cf9c7 (patch)
treeb05ba91367438b07644dc4d136aa6c54bce5c4a8 /src/com/android/browser/preferences
parent7cff891f31311139e215e3948198843bcafd6137 (diff)
downloadpackages_apps_Browser-5d513105dff9f453872be40f8bed2391396cf9c7.zip
packages_apps_Browser-5d513105dff9f453872be40f8bed2391396cf9c7.tar.gz
packages_apps_Browser-5d513105dff9f453872be40f8bed2391396cf9c7.tar.bz2
Move inverted mode to Accessibility settings
Add contrast settings bug:5111259 Change-Id: Ic95e1fbae94c01fc8560cbd326503244b9ab4988
Diffstat (limited to 'src/com/android/browser/preferences')
-rw-r--r--src/com/android/browser/preferences/AccessibilityPreferencesFragment.java13
-rw-r--r--src/com/android/browser/preferences/WebViewPreview.java2
2 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/browser/preferences/AccessibilityPreferencesFragment.java b/src/com/android/browser/preferences/AccessibilityPreferencesFragment.java
index b7d06a1..312a61e 100644
--- a/src/com/android/browser/preferences/AccessibilityPreferencesFragment.java
+++ b/src/com/android/browser/preferences/AccessibilityPreferencesFragment.java
@@ -45,6 +45,9 @@ public class AccessibilityPreferencesFragment extends PreferenceFragment
e = findPreference(PreferenceKeys.PREF_TEXT_ZOOM);
e.setOnPreferenceChangeListener(this);
updateTextZoomSummary(e, settings.getTextZoom());
+ e = findPreference(PreferenceKeys.PREF_INVERTED_CONTRAST);
+ e.setOnPreferenceChangeListener(this);
+ updateInvertedContrastSummary(e, (int) (settings.getInvertedContrast() * 100));
}
void updateMinFontSummary(Preference pref, int minFontSize) {
@@ -56,6 +59,10 @@ public class AccessibilityPreferencesFragment extends PreferenceFragment
pref.setSummary(mFormat.format(textZoom / 100.0));
}
+ void updateInvertedContrastSummary(Preference pref, int contrast) {
+ pref.setSummary(mFormat.format(contrast / 100.0));
+ }
+
@Override
public boolean onPreferenceChange(Preference pref, Object objValue) {
if (getActivity() == null) {
@@ -72,7 +79,11 @@ public class AccessibilityPreferencesFragment extends PreferenceFragment
updateTextZoomSummary(pref, BrowserSettings
.getAdjustedTextZoom((Integer) objValue));
}
+ if (PreferenceKeys.PREF_INVERTED_CONTRAST.equals(pref.getKey())) {
+ updateInvertedContrastSummary(pref,
+ (int) ((10 + (Integer) objValue) * 10));
+ }
return true;
}
-} \ No newline at end of file
+}
diff --git a/src/com/android/browser/preferences/WebViewPreview.java b/src/com/android/browser/preferences/WebViewPreview.java
index 1886bed..27c4f00 100644
--- a/src/com/android/browser/preferences/WebViewPreview.java
+++ b/src/com/android/browser/preferences/WebViewPreview.java
@@ -17,6 +17,7 @@
package com.android.browser.preferences;
import com.android.browser.BrowserSettings;
+import com.android.browser.PreferenceKeys;
import com.android.browser.R;
import android.content.Context;
@@ -68,6 +69,7 @@ public class WebViewPreview extends Preference implements OnSharedPreferenceChan
BrowserSettings bs = BrowserSettings.getInstance();
ws.setMinimumFontSize(bs.getMinimumFontSize());
ws.setTextZoom(bs.getTextZoom());
+ ws.setProperty(PreferenceKeys.PREF_INVERTED_CONTRAST, Float.toString(bs.getInvertedContrast()));
mWebView.loadData(mHtml, "text/html", "utf-8");
}