From 1f436509f0f497735f1de8dc984683eec158292c Mon Sep 17 00:00:00 2001 From: shaoweishen Date: Mon, 6 Jan 2025 10:03:53 +0000 Subject: [PATCH] [Physical Keyboard] Fix L18n test bugs 1. update string to match with Markup 2. a space for label keys as suggested Bug: 387267421 Bug: 387572420 Flag: com.android.settings.keyboard.keyboard_and_touchpad_a11y_new_page_enabled Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/inputmethod Change-Id: I787cf6ff4e15509d669317a0d968235a08b4dc43 --- res/values/strings.xml | 2 +- res/xml/physical_keyboard_settings.xml | 3 +-- .../settings/inputmethod/MouseKeysImageListAdapter.java | 6 ++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 4d843fb85cf..e08e6000115 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -4699,7 +4699,7 @@ Use the \“%s\” key to click the secondary mouse button - Keyboard shortcuts + View keyboard shortcuts Show list of shortcuts diff --git a/res/xml/physical_keyboard_settings.xml b/res/xml/physical_keyboard_settings.xml index 56914052b28..b7538c8ea5a 100644 --- a/res/xml/physical_keyboard_settings.xml +++ b/res/xml/physical_keyboard_settings.xml @@ -24,8 +24,7 @@ android:title="@string/keyboard_options_category"> + android:title="@string/keyboard_shortcuts_helper"/> { + private static final String LABEL_DELIMITER = ", "; private static final ImmutableList DRAWABLE_LIST = ImmutableList.of( R.drawable.mouse_keys_directional, R.drawable.mouse_keys_click, R.drawable.mouse_keys_press_hold, R.drawable.mouse_keys_release, @@ -93,7 +94,7 @@ public class MouseKeysImageListAdapter extends List directionalLabelList = DIRECTIONAL_CHAR_KEYCODE_LIST.stream().map( (key) -> getDisplayLabel(currentInputDevice, key)).toList(); mComposedSummaryList.add(context.getString(R.string.mouse_keys_directional_summary, - String.join(",", directionalLabelList))); + String.join(LABEL_DELIMITER, directionalLabelList))); String leftClickLabel = getDisplayLabel(currentInputDevice, LEFT_CLICK_CHAR_KEYCODE); mComposedSummaryList.add( context.getString(R.string.mouse_keys_click_summary, leftClickLabel)); @@ -107,7 +108,8 @@ public class MouseKeysImageListAdapter extends (key) -> getDisplayLabel(currentInputDevice, key)).toList(); mComposedSummaryList.add(context.getString(R.string.mouse_keys_toggle_scroll_summary, toggleScrollLabelList.getFirst(), - String.join(",", toggleScrollLabelList.subList(1, toggleScrollLabelList.size())) + String.join(LABEL_DELIMITER, + toggleScrollLabelList.subList(1, toggleScrollLabelList.size())) )); String rightClickLabel = getDisplayLabel(currentInputDevice, RIGHT_CLICK_CHAR_KEYCODE); mComposedSummaryList.add(