summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-17 01:26:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-16 22:04:55 +0000
commit7babd05509ea33f507f3525fbe065093d5877779 (patch)
tree51f03fc80fa9ab6b313834704d7dc0fa1b96736e /src/com/android
parent0128374aae5f9b748ade7d347fd267969ce726b9 (diff)
parentfc72424cd7c3bbb6d45afb77e5ffb619d38ef641 (diff)
downloadpackages_apps_Settings-7babd05509ea33f507f3525fbe065093d5877779.tar.gz
packages_apps_Settings-7babd05509ea33f507f3525fbe065093d5877779.tar.bz2
packages_apps_Settings-7babd05509ea33f507f3525fbe065093d5877779.zip
Merge "Accessibility text contrast control" into lmp-dev
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/settings/accessibility/AccessibilitySettings.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index b11629057..f035d7b4c 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -78,6 +78,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
// Preferences
private static final String TOGGLE_LARGE_TEXT_PREFERENCE =
"toggle_large_text_preference";
+ private static final String TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE =
+ "toggle_high_text_contrast_preference";
private static final String TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE =
"toggle_power_button_ends_call_preference";
private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE =
@@ -182,6 +184,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
private PreferenceCategory mSystemsCategory;
private CheckBoxPreference mToggleLargeTextPreference;
+ private CheckBoxPreference mToggleHighTextContrastPreference;
private CheckBoxPreference mTogglePowerButtonEndsCallPreference;
private CheckBoxPreference mToggleLockScreenRotationPreference;
private CheckBoxPreference mToggleSpeakPasswordPreference;
@@ -246,6 +249,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
if (mToggleLargeTextPreference == preference) {
handleToggleLargeTextPreferenceClick();
return true;
+ } else if (mToggleHighTextContrastPreference == preference) {
+ handleToggleTextContrastPreferenceClick();
+ return true;
} else if (mTogglePowerButtonEndsCallPreference == preference) {
handleTogglePowerButtonEndsCallPreferenceClick();
return true;
@@ -274,6 +280,12 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
}
}
+ private void handleToggleTextContrastPreferenceClick() {
+ Settings.Secure.putInt(getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED,
+ (mToggleHighTextContrastPreference.isChecked() ? 1 : 0));
+ }
+
private void handleTogglePowerButtonEndsCallPreferenceClick() {
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
@@ -325,6 +337,10 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
mToggleLargeTextPreference =
(CheckBoxPreference) findPreference(TOGGLE_LARGE_TEXT_PREFERENCE);
+ // Text contrast.
+ mToggleHighTextContrastPreference =
+ (CheckBoxPreference) findPreference(TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE);
+
// Power button ends calls.
mTogglePowerButtonEndsCallPreference =
(CheckBoxPreference) findPreference(TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE);
@@ -493,6 +509,9 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
}
mToggleLargeTextPreference.setChecked(mCurConfig.fontScale == LARGE_FONT_SCALE);
+ mToggleHighTextContrastPreference.setChecked(
+ AccessibilityManager.getInstance(getActivity()).isHighTextContrastEnabled());
+
// Power button ends calls.
if (KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_POWER)
&& Utils.isVoiceCapable(getActivity())) {