[Physical Keyboard] update color of Dialog

1. update color of slider in dialog to increase contrast
2. not showing device name in Mouse key page if there's only one device
   connected
Bug: 374030364
Bug: 377464791
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: I94d7859ba1dfdad7fdca2ee750a5afeb881756f4
This commit is contained in:
shaoweishen
2025-02-10 09:27:25 +00:00
parent 90feafb10a
commit 5daef3cfee
5 changed files with 15 additions and 1 deletions

View File

@@ -124,6 +124,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:progressBackgroundTint="@color/input_dialog_slider_progress_background"
android:progressTint="@color/input_dialog_slider_progress"
android:thumbTint="@color/input_dialog_slider_progress"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:visibility="gone"/> android:visibility="gone"/>
</LinearLayout> </LinearLayout>

View File

@@ -86,5 +86,8 @@
<!-- Volume seekbar colors --> <!-- Volume seekbar colors -->
<color name="seekbar_thumb_tint_color">@android:color/system_accent1_100</color> <color name="seekbar_thumb_tint_color">@android:color/system_accent1_100</color>
<color name="seekbar_progress_tint_color">@android:color/system_accent1_100</color> <color name="seekbar_progress_tint_color">@android:color/system_accent1_100</color>
<!-- Keyboard a11y input dialog -->
<color name="input_dialog_slider_progress">@android:color/system_on_primary_container_dark</color>
</resources> </resources>

View File

@@ -227,4 +227,8 @@
<color name="seekbar_thumb_tint_color">@android:color/system_accent1_800</color> <color name="seekbar_thumb_tint_color">@android:color/system_accent1_800</color>
<color name="seekbar_progress_tint_color">@android:color/system_accent1_800</color> <color name="seekbar_progress_tint_color">@android:color/system_accent1_800</color>
<color name="seekbar_progress_background_tint_color">@android:color/system_neutral2_50</color> <color name="seekbar_progress_background_tint_color">@android:color/system_neutral2_50</color>
<!-- Keyboard a11y input dialog -->
<color name="input_dialog_slider_progress">@android:color/system_on_primary_dark</color>
<color name="input_dialog_slider_progress_background">@android:color/system_outline_light</color>
</resources> </resources>

View File

@@ -77,6 +77,9 @@ public class MouseKeysImageListAdapter extends
@Override @Override
public void onBindViewHolder(@NonNull MouseKeyImageViewHolder holder, int position) { public void onBindViewHolder(@NonNull MouseKeyImageViewHolder holder, int position) {
if (mComposedSummaryList.isEmpty()) {
return;
}
((MouseKeyImageViewHolder) holder).bindView(DRAWABLE_LIST.get(position), ((MouseKeyImageViewHolder) holder).bindView(DRAWABLE_LIST.get(position),
mComposedSummaryList.get(position)); mComposedSummaryList.get(position));
} }

View File

@@ -63,7 +63,8 @@ public class MouseKeysMainPageFragment extends DashboardFragment
mMouseKeyImagesPreference = screen.findPreference(KEY_MOUSE_KEY_LIST); mMouseKeyImagesPreference = screen.findPreference(KEY_MOUSE_KEY_LIST);
mInputManager = Preconditions.checkNotNull(getActivity() mInputManager = Preconditions.checkNotNull(getActivity()
.getSystemService(InputManager.class)); .getSystemService(InputManager.class));
String title = mCurrentInputDevice == null ? getActivity().getString(R.string.mouse_keys) String title = mCurrentInputDevice == null || getHardKeyboards(getContext()).size() == 1
? getActivity().getString(R.string.mouse_keys)
: getActivity().getString(R.string.mouse_key_main_page_title, : getActivity().getString(R.string.mouse_key_main_page_title,
mCurrentInputDevice.getName()); mCurrentInputDevice.getName());
getActivity().setTitle(title); getActivity().setTitle(title);