Update magnification strings

- Adjusts string for triple-tap instructions
- Adds summary text to Settings > Accessibility > Magnification

Bug: 30960346
Test: Manual
Change-Id: I151eeaa8b08c86ba8f9dec90d14388f1d775fb57
This commit is contained in:
Casey Burkhardt
2017-03-24 19:24:34 -07:00
parent bc3827d717
commit 5477832096
2 changed files with 24 additions and 1 deletions

View File

@@ -4093,6 +4093,8 @@
<string name="accessibility_screen_magnification_gestures_title">Magnify with triple-tap</string>
<!-- Title for the accessibility preference screen to enable navigation bar screen magnification. [CHAR LIMIT=35] -->
<string name="accessibility_screen_magnification_navbar_title">Magnify with button</string>
<!-- Summary for the accessibility magnification setting indicating both "Magnify with button" and "Magnify with triple-tap" are enabled [CHAR LIMIT=50] -->
<string name="accessibility_screen_magnification_state_navbar_gesture">Magnify with button &amp; triple-tap</string>
<!-- Summary for the accessibility preference to enable screen magnification. [CHAR LIMIT=25] -->
<string name="accessibility_preference_magnification_summary">Zoom in on screen</string>
<!-- Short summary for Magnification gesture. Tells the user that this feature allows the user to magnify the screen by tapping 3 times. Appears in accessibility portion of setup wizard -->
@@ -4100,7 +4102,7 @@
<!-- Short summary for nav bar Magnification. Tells the user that this feature allows the user to magnify the screen using a button in the nav bar -->
<string name="accessibility_screen_magnification_navbar_short_summary">Tap a button to zoom</string>
<!-- Summary for the accessibility preference screen to enable screen magnification gestures. [CHAR LIMIT=none] -->
<string name="accessibility_screen_magnification_summary"><b>To zoom</b>, quickly tap the screen 3 times with one finger.\n<ul><li>Drag 2 or more fingers to scroll</li>\n<li>Pinch 2 or more fingers together or apart to adjust zoom</li></ul>\n\n<b>To zoom temporarily</b>, quickly tap the screen 3 times and hold down your finger on the third tap.\n<ul><li>Drag your finger to move around the screen</li>\n<li>Lift your finger to zoom out</li></ul>\n\nYou can\'t zoom in on the keyboard and navigation bar.</string>
<string name="accessibility_screen_magnification_summary"><b>To zoom</b>, quickly tap the screen 3 times.\n<ul><li>Drag 2 or more fingers to scroll</li>\n<li>Pinch 2 or more fingers to adjust zoom</li></ul>\n\n<b>To zoom temporarily</b>, quickly tap the screen 3 times and hold down your finger on the third tap.\n<ul><li>Drag to move around the screen</li>\n<li>Lift finger to zoom out</li></ul>\n\nYou can\'t zoom in on the keyboard and navigation bar.</string>
<!-- Summary for the accessibility preference screen to enable screen magnification via the nav bar. [CHAR LIMIT=none] -->
<string name="accessibility_screen_magnification_navbar_summary">When magnification is turned on, use the Accessibility button at the bottom of the screen to quickly magnify.\n\n<b>To zoom</b>, tap the Accessibility button, then tap anywhere on the screen.\n<ul><li>Drag 2 or more fingers to scroll</li>\n<li>Pinch 2 or more fingers to adjust zoom</li></ul>\n\n<b>To zoom temporarily</b>, tap the Accessibility button, then touch &amp; hold anywhere on the screen.\n<ul><li>Drag to move around the screen</li>\n<li>Lift finger to zoom out</li></ul>\n\nYou cant zoom in on the keyboard or navigation bar.</string>
<!-- Summary text appearing on the accessibility preference screen to enable screen magnification from the nav bar when the feature is enabled, but the accessibility button is not configured correctly for the feature to be used [CHAR LIMIT=none] -->

View File

@@ -587,6 +587,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
updateFeatureSummary(Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
mDisplayDaltonizerPreferenceScreen);
updateMagnificationSummary(mDisplayMagnificationPreferenceScreen);
updateFontSizeSummary(mFontSizePreferenceScreen);
updateAutoclickSummary(mAutoclickPreferenceScreen);
@@ -594,6 +596,25 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
updateAccessibilityShortcut(mAccessibilityShortcutPreferenceScreen);
}
private void updateMagnificationSummary(Preference pref) {
final boolean tripleTapEnabled = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, 0) == 1;
final boolean buttonEnabled = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, 0) == 1;
int summaryResId = 0;
if (!tripleTapEnabled && !buttonEnabled) {
summaryResId = R.string.accessibility_feature_state_off;
} else if (!tripleTapEnabled && buttonEnabled) {
summaryResId = R.string.accessibility_screen_magnification_navbar_title;
} else if (tripleTapEnabled && !buttonEnabled) {
summaryResId = R.string.accessibility_screen_magnification_gestures_title;
} else {
summaryResId = R.string.accessibility_screen_magnification_state_navbar_gesture;
}
pref.setSummary(summaryResId);
}
private void updateFeatureSummary(String prefKey, Preference pref) {
final boolean enabled = Settings.Secure.getInt(getContentResolver(), prefKey, 0) == 1;
pref.setSummary(enabled ? R.string.accessibility_feature_state_on