diff options
Diffstat (limited to 'src/com/android/browser/preferences')
-rw-r--r-- | src/com/android/browser/preferences/AccessibilityPreferencesFragment.java | 13 | ||||
-rw-r--r-- | src/com/android/browser/preferences/WebViewPreview.java | 2 |
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"); } |