Adds a summary to the (screen) Magnification preference for the main A11y Settings page.

This helps differentiate this from other magnification tools.

Reuses (and slightly modifies) the `magnification_feature_summary`
string which was not used by any existing code. This helps ensure
the existing localizations should be close enough, until L10n
translators have time to update based on the new shorter version.

Bug: 303499185
Test: ToggleScreenMagnificationPreferenceFragmentTest
Test: Open Settings > Accessibility, observe summary
Change-Id: If5ee4f937bbd655b425d4767ad8bbcef08dbe345
This commit is contained in:
Daniel Norman
2023-12-05 23:14:35 +00:00
parent 3fddb64a0d
commit 01e624c76b
3 changed files with 24 additions and 9 deletions

View File

@@ -840,9 +840,13 @@ public class ToggleScreenMagnificationPreferenceFragment extends
*/
public static CharSequence getServiceSummary(Context context) {
// Get the user shortcut type from settings provider.
final int uerShortcutType = getUserShortcutTypeFromSettings(context);
return (uerShortcutType != AccessibilityUtil.UserShortcutType.EMPTY)
final int userShortcutType = getUserShortcutTypeFromSettings(context);
final CharSequence featureState =
(userShortcutType != AccessibilityUtil.UserShortcutType.EMPTY)
? context.getText(R.string.accessibility_summary_shortcut_enabled)
: context.getText(R.string.generic_accessibility_feature_shortcut_off);
final CharSequence featureSummary = context.getText(R.string.magnification_feature_summary);
return context.getString(R.string.preference_summary_default_combination,
featureState, featureSummary);
}
}