Merge "Fix number localization in the strings.xml" into sc-dev

This commit is contained in:
Ryan Lin
2021-06-01 02:59:06 +00:00
committed by Android (Google) Code Review
3 changed files with 23 additions and 13 deletions

View File

@@ -5273,16 +5273,16 @@
<string name="accessibility_screen_magnification_summary">
<![CDATA[Quickly zoom in on the screen to make content larger.<br/><br/>
<b>To zoom in:</b><br/>
1. Use shortcut to start magnification<br/>
2. Tap the screen<br/>
3. Drag 2 fingers to move around screen<br/>
4. Pinch with 2 fingers to adjust zoom<br/>
5. Use shortcut to stop magnification<br/><br/>
{0,number,integer}. Use shortcut to start magnification<br/>
{1,number,integer}. Tap the screen<br/>
{2,number,integer}. Drag 2 fingers to move around screen<br/>
{3,number,integer}. Pinch with 2 fingers to adjust zoom<br/>
{4,number,integer}. Use shortcut to stop magnification<br/><br/>
<b>To zoom in temporarily:</b><br/>
1. Use shortcut to start magnification<br/>
2. Touch & hold anywhere on the screen<br/>
3. Drag finger to move around screen<br/>
4. Lift finger to stop magnification
{0,number,integer}. Use shortcut to start magnification<br/>
{1,number,integer}. Touch & hold anywhere on the screen<br/>
{2,number,integer}. Drag finger to move around screen<br/>
{3,number,integer}. Lift finger to stop magnification
]]>
</string>
<!-- Summary for the accessibility preference screen to enable screen magnification via the nav bar. [CHAR LIMIT=none] -->
@@ -5348,7 +5348,7 @@
<!-- Part of list to compose user's accessibility shortcut list. [CHAR LIMIT=NONE] -->
<string name="accessibility_shortcut_triple_tap_keyword">triple-tap screen</string>
<!-- 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 shortcut may slow down your device</string>
<string name="accessibility_shortcut_edit_dialog_summary_triple_tap">Quickly tap screen {0,number,integer} 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=20] -->
<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] -->

View File

@@ -24,6 +24,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.icu.text.MessageFormat;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
@@ -318,8 +319,12 @@ public class AccessibilityEditDialogUtils {
final View dialogView = view.findViewById(R.id.triple_tap_shortcut);
final CharSequence title = context.getText(
R.string.accessibility_shortcut_edit_dialog_title_triple_tap);
final CharSequence summary = context.getText(
String summary = context.getString(
R.string.accessibility_shortcut_edit_dialog_summary_triple_tap);
// Format the number '3' in the summary.
final Object[] arguments = {3};
summary = MessageFormat.format(summary, arguments);
setupShortcutWidget(dialogView, title, summary,
R.drawable.accessibility_shortcut_type_triple_tap);
// TODO(b/142531156): Use vector drawable instead of temporal png file to avoid distorted.

View File

@@ -14,6 +14,7 @@
package com.android.settings.accessibility;
import android.content.Context;
import android.icu.text.MessageFormat;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
@@ -93,8 +94,12 @@ public class MagnificationGesturesPreferenceController extends TogglePreferenceC
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED);
extras.putInt(AccessibilitySettings.EXTRA_TITLE_RES,
R.string.accessibility_screen_magnification_gestures_title);
extras.putCharSequence(AccessibilitySettings.EXTRA_HTML_DESCRIPTION,
context.getText(R.string.accessibility_screen_magnification_summary));
String summary = context.getString(R.string.accessibility_screen_magnification_summary);
final Object[] numberArguments = {1, 2, 3, 4, 5};
summary = MessageFormat.format(summary, numberArguments);
extras.putCharSequence(AccessibilitySettings.EXTRA_HTML_DESCRIPTION, summary);
extras.putInt(AccessibilitySettings.EXTRA_VIDEO_RAW_RESOURCE_ID,
R.raw.accessibility_screen_magnification);
}