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

- Link-up between the ResetPreference and the FontWeightAdjustmentPreference.

Bug: 211503117
Test: atest FontWeightAdjustmentPreferenceControllerTest
Change-Id: Iabf585660ff2c67f063198391bd68724190ba54d
This commit is contained in:
Peter_Liang
2022-02-06 23:31:27 +08:00
parent f71050b515
commit 618508c0c4
4 changed files with 26 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
private static final String DISPLAY_SIZE_KEY = "display_size";
private static final String PREVIEW_KEY = "preview";
private static final String RESET_KEY = "reset";
private static final String BOLD_TEXT_KEY = "toggle_force_bold_text";
@Override
protected int getPreferenceScreenResId() {
@@ -78,6 +79,10 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
displaySizeController.setInteractionListener(previewController);
controllers.add(displaySizeController);
final FontWeightAdjustmentPreferenceController fontWeightController =
new FontWeightAdjustmentPreferenceController(context, BOLD_TEXT_KEY);
controllers.add(fontWeightController);
final List<ResetStateListener> resetStateListeners =
controllers.stream().filter(c -> c instanceof ResetStateListener).map(
c -> (ResetStateListener) c).collect(Collectors.toList());