Files
app_Settings/res/xml/accessibility_daltonizer_settings.xml
Chun-Ku Lin ec61f8bea3 Move PreferenceControllers to member variables to prevent memory leak
- Move PreferenceControllers to xml
- Clean up the PreferenceController so that it's less tied to a fragment
- Update and clean up the related robolectric test, so there are less
  mocks needed

Bug: 352606511
Test: manually check the Color Correction screen is shown correctly, and
choosing color correction options are reflected correctly
Test: atest DaltonizerRadioButtonPreferenceControllerTest
Test: atest ToggleDaltonizerPreferenceFragmentTest
Flag: EXEMPT (moving controller to xml can't be flagged)

Change-Id: I89b9366cfd7a398bb0572d34226d31d49373fd94
2024-07-15 21:34:14 +00:00

65 lines
3.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 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:persistent="false"
android:title="@string/accessibility_display_daltonizer_preference_title">
<com.android.settings.accessibility.PaletteListPreference
android:key="daltonizer_preview"
android:persistent="false"
android:selectable="false"
android:title="@string/summary_placeholder"
settings:allowDividerBelow="true"
settings:searchable="false"/>
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="daltonizer_mode_deuteranomaly"
android:persistent="false"
android:summary="@string/daltonizer_mode_deuteranomaly_summary"
android:title="@string/daltonizer_mode_deuteranomaly_title"
settings:controller="com.android.settings.accessibility.DaltonizerRadioButtonPreferenceController" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="daltonizer_mode_protanomaly"
android:persistent="false"
android:summary="@string/daltonizer_mode_protanomaly_summary"
android:title="@string/daltonizer_mode_protanomaly_title"
settings:controller="com.android.settings.accessibility.DaltonizerRadioButtonPreferenceController" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="daltonizer_mode_tritanomaly"
android:persistent="false"
android:summary="@string/daltonizer_mode_tritanomaly_summary"
android:title="@string/daltonizer_mode_tritanomaly_title"
settings:controller="com.android.settings.accessibility.DaltonizerRadioButtonPreferenceController" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="daltonizer_mode_grayscale"
android:persistent="false"
android:title="@string/daltonizer_mode_grayscale_title"
settings:controller="com.android.settings.accessibility.DaltonizerRadioButtonPreferenceController" />
<com.android.settings.widget.SeekBarPreference
android:key="daltonizer_saturation"
android:persistent="false"
android:title="@string/daltonizer_saturation_title"
settings:controller="com.android.settings.accessibility.DaltonizerSaturationSeekbarPreferenceController"
/>
</PreferenceScreen>