Add content description to screensaver customization button

This will let users know which screensaver they are customizing.

Fixes: 267582102
Test: flashed device and enabled talkback, opened screensaver settings,
and verified talkback correctly says the name of the screensaver

Change-Id: I9d0d9422f06b7a78efca0e6953b73fe612f79e2a
This commit is contained in:
Lucas Silva
2023-02-03 15:27:26 -05:00
parent c4a0475681
commit ca65b6e5ba
2 changed files with 5 additions and 0 deletions

View File

@@ -14451,6 +14451,8 @@
<!-- Button to customize the screensaver [CHAR LIMIT=20] -->
<string name="customize_button_title">Customize</string>
<!-- The content description for accessibility tools of the customize button. It specifies which screensaver the user is customizing [CHAR LIMIT=NONE] -->
<string name="customize_button_description">Customize <xliff:g id="screensaver_name" example="Art Gallery">%1$s</xliff:g></string>
<!-- Dialog body text used to explain a reboot is required after enabling freeform support for
it to work [CHAR LIMIT=none] -->

View File

@@ -129,6 +129,9 @@ public class DreamAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
// This must be called AFTER itemView.setSelected above, in order to keep the
// customize button in an unselected state.
mCustomizeButton.setSelected(false);
mCustomizeButton.setContentDescription(
mContext.getResources().getString(R.string.customize_button_description,
item.getTitle()));
}
setEnabledStateOnViews(itemView, mEnabled);