Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fb14e1e authored by marcusge's avatar marcusge
Browse files

[Accessibility] Migrate high text contrast under feature flag

Add Maximize Text contrast into contrast screen and hide it in "Display size and text" under feature flag

Test: manually
Bug: 241805782
Flag: aconfig
com.android.settings.accessibility.enable_color_contrast_control

Change-Id: I69049a136beba00a311c3c94fc9a49b0219a870e
parent cddd7b36
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4922,6 +4922,10 @@
    <string name="accessibility_toggle_high_text_contrast_preference_title">High contrast text</string>
    <!-- Summary for the accessibility preference to high contrast text. [CHAR LIMIT=NONE] -->
    <string name="accessibility_toggle_high_text_contrast_preference_summary">Change text color to black or white. Maximizes contrast with the background.</string>
    <!-- Title for the accessibility preference to high contrast text. [CHAR LIMIT=35] -->
    <string name="accessibility_toggle_maximize_text_contrast_preference_title">Maximize text contrast</string>
    <!-- Summary for the accessibility preference to high contrast text. [CHAR LIMIT=NONE] -->
    <string name="accessibility_toggle_maximize_text_contrast_preference_summary">Change text color to black or white to increase contrast with the background.</string>
    <!-- Title for the accessibility preference to auto update screen magnification. [CHAR LIMIT=35] -->
    <string name="accessibility_toggle_screen_magnification_auto_update_preference_title">Auto
        update screen magnification</string>
+8 −0
Original line number Diff line number Diff line
@@ -30,6 +30,14 @@
        android:layout="@layout/accessibility_color_contrast_selector"
        settings:controller="com.android.settings.accessibility.ContrastSelectorPreferenceController"/>

    <SwitchPreferenceCompat
        android:key="toggle_high_text_contrast_preference"
        android:persistent="false"
        android:summary="@string/accessibility_toggle_maximize_text_contrast_preference_summary"
        android:title="@string/accessibility_toggle_maximize_text_contrast_preference_title"
        settings:controller=
            "com.android.settings.accessibility.HighTextContrastPreferenceController" />

    <com.android.settings.accessibility.AccessibilityFooterPreference
        android:title="@string/color_contrast_note"
        android:selectable="false"
+1 −3
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@
        android:key="toggle_high_text_contrast_preference"
        android:persistent="false"
        android:summary="@string/accessibility_toggle_high_text_contrast_preference_summary"
        android:title="@string/accessibility_toggle_high_text_contrast_preference_title"
        settings:controller=
            "com.android.settings.accessibility.HighTextContrastPreferenceController" />
        android:title="@string/accessibility_toggle_high_text_contrast_preference_title" />

    <com.android.settings.accessibility.TextReadingResetPreference
        android:key="reset"
+11 −4
Original line number Diff line number Diff line
@@ -117,6 +117,11 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
                }
            }
        }

        if (Flags.enableColorContrastControl()) {
            // High text contrast toggle will be added inside Color Contrast page on V+.
            removePreference(HIGH_TEXT_CONTRAST_KEY);
        }
    }

    @Override
@@ -203,10 +208,12 @@ public class TextReadingPreferenceFragment extends DashboardFragment {
        mFontWeightAdjustmentController.setEntryPoint(mEntryPoint);
        controllers.add(mFontWeightAdjustmentController);

        if (!Flags.enableColorContrastControl()) {
            final HighTextContrastPreferenceController highTextContrastController =
                    new HighTextContrastPreferenceController(context, HIGH_TEXT_CONTRAST_KEY);
            highTextContrastController.setEntryPoint(mEntryPoint);
            controllers.add(highTextContrastController);
        }

        final TextReadingResetController resetController =
                new TextReadingResetController(context, RESET_KEY,