Announce scaled value for font scaling seekbar in Talkback

1. Keeping state descriptions for the seekbar as an array in the
   PreviewSizeSeekBarController when we would like to customize the
   state description.
2. Setting the scaled value to be the state description for the font
   scaling seekbar when there is a progress change to the seekbar.

Bug: 269212483
Test: manually - attach videos to the bug
Test: make RunSettingsRoboTests ROBOTEST_FILTER=PreviewSizeSeekBarControllerTest
Change-Id: I8e9e3681a0174f454cac871ebf62d785962c7165
This commit is contained in:
Candice Lo
2023-03-30 17:56:56 +00:00
parent 5e8769bcc5
commit d2c53a2085
3 changed files with 64 additions and 2 deletions

View File

@@ -170,6 +170,15 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
R.string.accessibility_font_scaling_auto_added_qs_tooltip_content);
}
};
final String[] labelArray = new String[fontSizeData.getValues().size()];
for (int i = 0; i < labelArray.length; i++) {
labelArray[i] =
context.getResources().getString(
com.android.settingslib.R.string.font_scale_percentage,
(int) (fontSizeData.getValues().get(i) * 100)
);
}
fontSizeController.setProgressStateLabels(labelArray);
fontSizeController.setInteractionListener(mPreviewController);
getSettingsLifecycle().addObserver(fontSizeController);
controllers.add(fontSizeController);