New feature “Text and reading options” for SetupWizard, Wallpaper, and Settings (12/n).

- Link-up between the preview, font size, and display size preferences.
- Add the preview preference and entry.

Bug: 211503117
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TextReadingPreviewControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TextReadingPreviewPreferenceTest
Change-Id: Ic6c48861a0051670fd78b13dca5488711de30cb8
This commit is contained in:
Peter_Liang
2022-01-27 15:37:36 +08:00
parent 0eee699438
commit edb52508d3
7 changed files with 386 additions and 11 deletions

View File

@@ -37,6 +37,7 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
private static final String TAG = "TextReadingPreferenceFragment";
private static final String FONT_SIZE_KEY = "font_size";
private static final String DISPLAY_SIZE_KEY = "display_size";
private static final String PREVIEW_KEY = "preview";
@Override
protected int getPreferenceScreenResId() {
@@ -58,9 +59,20 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
final List<AbstractPreferenceController> controllers = new ArrayList<>();
final FontSizeData fontSizeData = new FontSizeData(context);
final DisplaySizeData displaySizeData = new DisplaySizeData(context);
controllers.add(new PreviewSizeSeekBarController(context, FONT_SIZE_KEY, fontSizeData));
controllers.add(
new PreviewSizeSeekBarController(context, DISPLAY_SIZE_KEY, displaySizeData));
final TextReadingPreviewController previewController = new TextReadingPreviewController(
context, PREVIEW_KEY, fontSizeData, displaySizeData);
controllers.add(previewController);
final PreviewSizeSeekBarController fontSizeController = new PreviewSizeSeekBarController(
context, FONT_SIZE_KEY, fontSizeData);
fontSizeController.setInteractionListener(previewController);
controllers.add(fontSizeController);
final PreviewSizeSeekBarController displaySizeController = new PreviewSizeSeekBarController(
context, DISPLAY_SIZE_KEY, displaySizeData);
displaySizeController.setInteractionListener(previewController);
controllers.add(displaySizeController);
return controllers;
}