Update the shortcut design strings.

Bug: 148837311
Test: Manual test

Change-Id: Iac96b3f36e4298aea36bbde5632f701ad1e9572d
This commit is contained in:
menghanli
2020-02-05 17:49:44 +08:00
parent 2ad3a3e0ab
commit 4705d87c4a
4 changed files with 29 additions and 35 deletions

View File

@@ -4780,7 +4780,7 @@
<!-- Title for the accessibility preference screen to enable video captioning. [CHAR LIMIT=35] --> <!-- Title for the accessibility preference screen to enable video captioning. [CHAR LIMIT=35] -->
<string name="accessibility_captioning_title">Caption preferences</string> <string name="accessibility_captioning_title">Caption preferences</string>
<!-- Title for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=35] --> <!-- Title for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=35] -->
<string name="accessibility_screen_magnification_title">Magnify</string> <string name="accessibility_screen_magnification_title">Magnification</string>
<!-- Title for the accessibility preference screen to edit magnification area. [CHAR LIMIT=35] --> <!-- Title for the accessibility preference screen to edit magnification area. [CHAR LIMIT=35] -->
<string name="accessibility_magnification_mode_title">Magnification area</string> <string name="accessibility_magnification_mode_title">Magnification area</string>
<!-- Title for the accessibility preference screen to edit magnification enable mode. [CHAR LIMIT=35] --> <!-- Title for the accessibility preference screen to edit magnification enable mode. [CHAR LIMIT=35] -->
@@ -4816,7 +4816,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 --> <!-- 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> <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] --> <!-- 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.\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> <string name="accessibility_screen_magnification_summary">Quickly zoom in on the screen to see content more clearly.\n\n<b>To zoom in:</b>\n\t1. Use shortcut to start magnification\n\t2. Tap the screen\n\t3. Drag 2 fingers to move around screen\n\t4. Pinch with 2 fingers to adjust zoom\n\t5. Use shortcut to stop magnification</string>
<!-- Summary for the accessibility preference screen to enable screen magnification via the nav bar. [CHAR LIMIT=none] --> <!-- 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, you can zoom in on your screen.\n\n<b>To zoom</b>, start magnification, 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>, start magnification, 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> <string name="accessibility_screen_magnification_navbar_summary">When magnification is turned on, you can zoom in on your screen.\n\n<b>To zoom</b>, start magnification, 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>, start magnification, 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>
<!-- Title for the Accessibility tutorial dialog in Accessibility service with button. [CHAR LIMIT=50] --> <!-- Title for the Accessibility tutorial dialog in Accessibility service with button. [CHAR LIMIT=50] -->
@@ -4838,35 +4838,29 @@
<!-- Button for the Accessibility tutorial dialog to dismiss the dialog when user clicks it. [CHAR LIMIT=10] --> <!-- Button for the Accessibility tutorial dialog to dismiss the dialog when user clicks it. [CHAR LIMIT=10] -->
<string name="accessibility_tutorial_dialog_button">Got it</string> <string name="accessibility_tutorial_dialog_button">Got it</string>
<!-- Title for accessibility shortcut preference for accessibility apps. [CHAR LIMIT=40] --> <!-- Title for accessibility shortcut preference for accessibility apps. [CHAR LIMIT=40] -->
<string name="accessibility_shortcut_title">Use shortcut to open</string> <string name="accessibility_shortcut_title"><xliff:g id="service" example="Select to Speak">%1$s</xliff:g> shortcut</string>
<!-- Title for accessibility shortcut preference for magnification. [CHAR LIMIT=40] -->
<string name="accessibility_magnification_shortcut_title">Use shortcut to magnify</string>
<!-- Title for Accessibility edit shortcut dialog. [CHAR LIMIT=40] -->
<string name="accessibility_shortcut_edit_dialog_title">Shortcut to open <xliff:g id="service" example="Select to Speak">%1$s</xliff:g></string>
<!-- Title for Accessibility edit shortcut dialog in Magnify. [CHAR LIMIT=40] -->
<string name="accessibility_shortcut_edit_dialog_title_magnification">Shortcut to magnify</string>
<!-- Title for Accessibility edit shortcut dialog in Color correction. [CHAR LIMIT=40] -->
<string name="accessibility_shortcut_edit_dialog_title_daltonizer">Shortcut to open Color correction</string>
<!-- Title for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Title for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_software">Accessibility Button</string> <string name="accessibility_shortcut_edit_summary_software">Accessibility Button</string>
<!-- Title for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation is enabled. [CHAR LIMIT=NONE] --> <!-- Title for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation is enabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_software_gesture">2-finger swipe up from bottom</string> <string name="accessibility_shortcut_edit_dialog_title_software_gesture">Swipe up with 2 fingers</string>
<!-- Title for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation and touch exploration are enabled. [CHAR LIMIT=NONE] --> <!-- Title for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation and touch exploration are enabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_software_gesture_talkback">3-finger swipe up from bottom</string> <string name="accessibility_shortcut_edit_dialog_title_software_gesture_talkback">Swipe up with 3 fingers</string>
<!-- Summary for accessibility shortcut preference for software shortcut type. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_software">Tap accessibility button</string>
<!-- Summary for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Summary for software shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_summary_software">Tap the <xliff:g id="accessibility_icon" example="[Icon]">%s</xliff:g> button at the bottom of your screen</string> <string name="accessibility_shortcut_edit_dialog_summary_software">Tap the accessibility button <xliff:g id="accessibility_icon" example="[Icon]">%s</xliff:g> at the bottom of your screen</string>
<!-- Summary for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation is enabled. [CHAR LIMIT=NONE] --> <!-- Summary for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation is enabled. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_summary_software_gesture">Swipe up with 2 fingers from edge of screen</string> <string name="accessibility_shortcut_edit_dialog_summary_software_gesture">Swipe up from the bottom of the screen with 2 fingers</string>
<!-- Summary for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation and touch exploration are enabled [CHAR LIMIT=NONE] --> <!-- Summary for software shortcut in gesture mode in Accessibility edit shortcut dialog while using gesture navigation and touch exploration are enabled [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_summary_software_gesture_talkback">Swipe up with 3 fingers from edge of screen</string> <string name="accessibility_shortcut_edit_dialog_summary_software_gesture_talkback">Swipe up from the bottom of the screen with 3 fingers</string>
<!-- Title for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Title for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_hardware">Hold volume keys</string> <string name="accessibility_shortcut_edit_dialog_title_hardware">Hold volume keys</string>
<!-- Summary for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Summary for hardware shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_summary_hardware">Press and hold both volume keys for 1 second</string> <string name="accessibility_shortcut_edit_dialog_summary_hardware">Press &amp; hold both volume keys for 1 second</string>
<!-- Title for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Title for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_title_triple_tap">Triple tap screen</string> <string name="accessibility_shortcut_edit_dialog_title_triple_tap">Triple-tap screen</string>
<!-- Summary for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] --> <!-- Summary for triple tap shortcut in Accessibility edit shortcut dialog. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_edit_dialog_summary_triple_tap">Quickly tap screen 3 times (this can slow down your device)</string> <string name="accessibility_shortcut_edit_dialog_summary_triple_tap">Quickly tap screen 3 times. This shortcut may slow down your device.</string>
<!-- Title for the Accessibility edit shortcut dialog to save the preference when user clicks it. [CHAR LIMIT=10] --> <!-- Title for the Accessibility edit shortcut dialog to save the preference when user clicks it. [CHAR LIMIT=10] -->
<string name="accessibility_shortcut_edit_dialog_title_advance">Advanced</string> <string name="accessibility_shortcut_edit_dialog_title_advance">Advanced</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] --> <!-- 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] -->
@@ -4930,9 +4924,9 @@
<!-- Title for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] --> <!-- Title for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_preference_title">Color inversion</string> <string name="accessibility_display_inversion_preference_title">Color inversion</string>
<!-- Used in the accessibility service settings to control turning display color inversion on/off entirely. [CHAR LIMIT=NONE] --> <!-- Used in the accessibility service settings to control turning display color inversion on/off entirely. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_switch_title">Invert colors</string> <string name="accessibility_display_inversion_switch_title">Use color inversion</string>
<!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] --> <!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_preference_subtitle">Turn light screens dark so people who are sensitive to bright light can have a better viewing experience.\n\nNote: dark colors will turn light. Images will also be inverted.</string> <string name="accessibility_display_inversion_preference_subtitle">Color inversion turns light screens dark. This helps people who are sensitive to bright light see the screen more easily.\n\nNote: Dark colors will turn light. Colors will change in media and images. You can also use Dark theme (Settings > Display).</string>
<!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] --> <!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] -->
<string name="accessibility_autoclick_preference_title">Auto click (dwell timing)</string> <string name="accessibility_autoclick_preference_title">Auto click (dwell timing)</string>
<!-- Footer text to explain what autoclick does --> <!-- Footer text to explain what autoclick does -->
@@ -4964,7 +4958,7 @@
<!-- Used in the accessibility service settings to control turning on/off the service entirely --> <!-- Used in the accessibility service settings to control turning on/off the service entirely -->
<string name="accessibility_service_master_switch_title">Use <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g></string> <string name="accessibility_service_master_switch_title">Use <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g></string>
<!-- Used in the Color correction settings screen to control turning on/off the feature entirely --> <!-- Used in the Color correction settings screen to control turning on/off the feature entirely -->
<string name="accessibility_daltonizer_master_switch_title">Correct colors</string> <string name="accessibility_daltonizer_master_switch_title">Use color correction</string>
<!-- Used in the Captions settings screen to control turning on/off the feature entirely --> <!-- Used in the Captions settings screen to control turning on/off the feature entirely -->
<string name="accessibility_caption_master_switch_title">Show captions</string> <string name="accessibility_caption_master_switch_title">Show captions</string>
<!-- Title for Caption preference settings screen for configuring font style. [CHAR LIMIT=NONE] --> <!-- Title for Caption preference settings screen for configuring font style. [CHAR LIMIT=NONE] -->
@@ -5084,9 +5078,6 @@
<!-- Title for accessibility menu item to launch a settings activity. [CHAR LIMIT=15] --> <!-- Title for accessibility menu item to launch a settings activity. [CHAR LIMIT=15] -->
<string name="accessibility_menu_item_settings">Settings</string> <string name="accessibility_menu_item_settings">Settings</string>
<!-- Title for accessibility menu item to launch a settings activity with app name. [CHAR LIMIT=30] -->
<string name="accessibility_service_menu_item_settings"><xliff:g example="TalkBack" id="accessibility_app_name">%1$s</xliff:g> settings</string>
<!-- Summary for the enabled state of an accessibility feature. [CHAR LIMIT=10] --> <!-- Summary for the enabled state of an accessibility feature. [CHAR LIMIT=10] -->
<string name="accessibility_feature_state_on">On</string> <string name="accessibility_feature_state_on">On</string>
<!-- Summary for the disabled state of an accessibility feature. [CHAR LIMIT=10] --> <!-- Summary for the disabled state of an accessibility feature. [CHAR LIMIT=10] -->

View File

@@ -437,8 +437,7 @@ public class AccessibilitySettings extends DashboardFragment {
final String settingsClassName = info.getSettingsActivityName(); final String settingsClassName = info.getSettingsActivityName();
if (!TextUtils.isEmpty(settingsClassName)) { if (!TextUtils.isEmpty(settingsClassName)) {
extras.putString(EXTRA_SETTINGS_TITLE, extras.putString(EXTRA_SETTINGS_TITLE,
getString(R.string.accessibility_service_menu_item_settings, getString(R.string.accessibility_menu_item_settings));
resolveInfo.loadLabel(getPackageManager())));
extras.putString(EXTRA_SETTINGS_COMPONENT_NAME, extras.putString(EXTRA_SETTINGS_COMPONENT_NAME,
new ComponentName(packageName, settingsClassName).flattenToString()); new ComponentName(packageName, settingsClassName).flattenToString());
} }

View File

@@ -235,7 +235,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
switch (dialogId) { switch (dialogId) {
case DialogEnums.EDIT_SHORTCUT: case DialogEnums.EDIT_SHORTCUT:
final CharSequence dialogTitle = getPrefContext().getString( final CharSequence dialogTitle = getPrefContext().getString(
R.string.accessibility_shortcut_edit_dialog_title, mPackageName); R.string.accessibility_shortcut_title, mPackageName);
Dialog dialog = AccessibilityEditDialogUtils.showEditShortcutDialog( Dialog dialog = AccessibilityEditDialogUtils.showEditShortcutDialog(
getPrefContext(), dialogTitle, this::callOnAlertDialogCheckboxClicked); getPrefContext(), dialogTitle, this::callOnAlertDialogCheckboxClicked);
initializeDialogCheckBox(dialog); initializeDialogCheckBox(dialog);
@@ -505,7 +505,7 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
private String getShortcutTypeSummary(Context context) { private String getShortcutTypeSummary(Context context) {
final int shortcutType = getUserShortcutType(context, UserShortcutType.SOFTWARE); final int shortcutType = getUserShortcutType(context, UserShortcutType.SOFTWARE);
int resId = R.string.accessibility_shortcut_edit_dialog_title_software; int resId = R.string.accessibility_shortcut_edit_summary_software;
if (AccessibilityUtil.isGestureNavigateEnabled(context)) { if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
resId = AccessibilityUtil.isTouchExploreEnabled(context) resId = AccessibilityUtil.isTouchExploreEnabled(context)
? R.string.accessibility_shortcut_edit_dialog_title_software_gesture_talkback ? R.string.accessibility_shortcut_edit_dialog_title_software_gesture_talkback
@@ -593,8 +593,10 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
mShortcutPreference = new ShortcutPreference(getPrefContext(), null); mShortcutPreference = new ShortcutPreference(getPrefContext(), null);
mShortcutPreference.setPersistent(false); mShortcutPreference.setPersistent(false);
mShortcutPreference.setKey(getShortcutPreferenceKey()); mShortcutPreference.setKey(getShortcutPreferenceKey());
mShortcutPreference.setTitle(R.string.accessibility_shortcut_title);
mShortcutPreference.setOnClickListener(this); mShortcutPreference.setOnClickListener(this);
final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
mShortcutPreference.setTitle(title);
} }
private void updateShortcutPreference() { private void updateShortcutPreference() {

View File

@@ -240,8 +240,8 @@ public class ToggleScreenMagnificationPreferenceFragment extends
return AccessibilityGestureNavigationTutorial return AccessibilityGestureNavigationTutorial
.showAccessibilityButtonTutorialDialog(getPrefContext()); .showAccessibilityButtonTutorialDialog(getPrefContext());
case DialogEnums.MAGNIFICATION_EDIT_SHORTCUT: case DialogEnums.MAGNIFICATION_EDIT_SHORTCUT:
final CharSequence dialogTitle = getPrefContext().getText( final CharSequence dialogTitle = getPrefContext().getString(
R.string.accessibility_shortcut_edit_dialog_title_magnification); R.string.accessibility_shortcut_title, mPackageName);
final AlertDialog dialog = final AlertDialog dialog =
AccessibilityEditDialogUtils.showMagnificationEditShortcutDialog( AccessibilityEditDialogUtils.showMagnificationEditShortcutDialog(
getPrefContext(), dialogTitle, getPrefContext(), dialogTitle,
@@ -338,7 +338,7 @@ public class ToggleScreenMagnificationPreferenceFragment extends
private String getShortcutTypeSummary(Context context) { private String getShortcutTypeSummary(Context context) {
final int shortcutType = getUserShortcutType(context, UserShortcutType.DEFAULT); final int shortcutType = getUserShortcutType(context, UserShortcutType.DEFAULT);
int resId = R.string.accessibility_shortcut_edit_dialog_title_software; int resId = R.string.accessibility_shortcut_edit_summary_software;
if (AccessibilityUtil.isGestureNavigateEnabled(context)) { if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
resId = AccessibilityUtil.isTouchExploreEnabled(context) resId = AccessibilityUtil.isTouchExploreEnabled(context)
? R.string.accessibility_shortcut_edit_dialog_title_software_gesture_talkback ? R.string.accessibility_shortcut_edit_dialog_title_software_gesture_talkback
@@ -481,9 +481,11 @@ public class ToggleScreenMagnificationPreferenceFragment extends
mShortcutPreference = new ShortcutPreference(getPrefContext(), null); mShortcutPreference = new ShortcutPreference(getPrefContext(), null);
mShortcutPreference.setPersistent(false); mShortcutPreference.setPersistent(false);
mShortcutPreference.setKey(KEY_SHORTCUT_PREFERENCE); mShortcutPreference.setKey(KEY_SHORTCUT_PREFERENCE);
mShortcutPreference.setTitle(R.string.accessibility_magnification_shortcut_title);
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext())); mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
mShortcutPreference.setOnClickListener(this); mShortcutPreference.setOnClickListener(this);
final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
mShortcutPreference.setTitle(title);
} }
private void updateShortcutPreference() { private void updateShortcutPreference() {