Files
app_Settings/res/xml/captioning_appearance.xml
menghanli 3a591f9a34 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
2022-07-15 06:55:54 +08:00

101 lines
4.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/captioning_caption_appearance_title">
<com.android.settingslib.widget.LayoutPreference
android:key="caption_preview"
android:title="@string/summary_placeholder"
android:layout="@layout/captioning_preview"
android:selectable="false"
settings:searchable="false"
settings:controller="com.android.settings.accessibility.CaptionPreviewPreferenceController"/>
<ListPreference
android:entries="@array/captioning_font_size_selector_titles"
android:entryValues="@array/captioning_font_size_selector_values"
android:key="captioning_font_size"
android:summary="%s"
android:title="@string/captioning_text_size"
settings:controller="com.android.settings.accessibility.CaptionFontSizeController"/>
<com.android.settings.accessibility.PresetPreference
android:key="captioning_preset"
android:title="@string/captioning_preset"/>
<PreferenceCategory
android:key="custom"
android:title="@string/captioning_custom_options_title">
<ListPreference
android:entries="@array/captioning_typeface_selector_titles"
android:entryValues="@array/captioning_typeface_selector_values"
android:key="captioning_typeface"
android:summary="%s"
android:title="@string/captioning_typeface"
settings:controller="com.android.settings.accessibility.CaptionTypefaceController"/>
<com.android.settings.accessibility.ColorPreference
android:key="captioning_foreground_color"
android:title="@string/captioning_foreground_color"/>
<com.android.settings.accessibility.ColorPreference
android:dependency="captioning_foreground_color"
android:key="captioning_foreground_opacity"
android:title="@string/captioning_foreground_opacity"/>
<com.android.settings.accessibility.EdgeTypePreference
android:key="captioning_edge_type"
android:title="@string/captioning_edge_type"/>
<com.android.settings.accessibility.ColorPreference
android:dependency="captioning_edge_type"
android:key="captioning_edge_color"
android:title="@string/captioning_edge_color"/>
<com.android.settings.accessibility.ColorPreference
android:key="captioning_background_color"
android:title="@string/captioning_background_color"/>
<com.android.settings.accessibility.ColorPreference
android:dependency="captioning_background_color"
android:key="captioning_background_opacity"
android:title="@string/captioning_background_opacity"/>
<com.android.settings.accessibility.ColorPreference
android:key="captioning_window_color"
android:title="@string/captioning_window_color"/>
<com.android.settings.accessibility.ColorPreference
android:dependency="captioning_window_color"
android:key="captioning_window_opacity"
android:title="@string/captioning_window_opacity"/>
</PreferenceCategory>
<com.android.settings.accessibility.AccessibilityFooterPreference
android:key="captioning_appearance_footer"
android:title="@string/accessibility_caption_preference_summary"
android:persistent="false"
android:selectable="false"
settings:searchable="false"
settings:controller="com.android.settings.accessibility.CaptionFooterPreferenceController"/>
</PreferenceScreen>