Refactor CaptionAppearanceFragment to improve maintainability (2/n)

Root cause: There is a bunch of different logic of preferences in CaptionAppearanceFragment. It’s hard to implement new features and hard to maintain and hard to be testable.
Solution: Move out font size and type face preference logic of CaptionAppearanceFragment into controllers to reduce the complexity of the relationship between preference and fragment.

Bug: 197695932
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.accessibility
Change-Id: Ia52cd272495d49a772c981f51e190ff7d29ee14f
This commit is contained in:
menghanli
2022-07-05 17:54:18 +08:00
parent 591e44bb99
commit 3a591f9a34
9 changed files with 431 additions and 69 deletions

View File

@@ -33,7 +33,8 @@
android:entryValues="@array/captioning_font_size_selector_values"
android:key="captioning_font_size"
android:summary="%s"
android:title="@string/captioning_text_size"/>
android:title="@string/captioning_text_size"
settings:controller="com.android.settings.accessibility.CaptionFontSizeController"/>
<com.android.settings.accessibility.PresetPreference
android:key="captioning_preset"
@@ -48,7 +49,8 @@
android:entryValues="@array/captioning_typeface_selector_values"
android:key="captioning_typeface"
android:summary="%s"
android:title="@string/captioning_typeface"/>
android:title="@string/captioning_typeface"
settings:controller="com.android.settings.accessibility.CaptionTypefaceController"/>
<com.android.settings.accessibility.ColorPreference
android:key="captioning_foreground_color"