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

Commit 13673f84 authored by Chuck Liao's avatar Chuck Liao Committed by Android (Google) Code Review
Browse files

Merge "Let Talkback announce to the user when changing dark/light theme" into sc-v2-dev

parents 2e4c0a10 17bc9141
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -233,6 +233,8 @@
    <!-- The title of mode section view. [CHAR_LIMIT=20] -->
    <string name="mode_title" msgid="1000319159005403986">Dark theme</string>
    <string name="mode_disabled_msg" msgid="1926077857799715086">Temporarily disabled due to Battery Saver</string>
    <!-- The text for A11y announcement when theme changes. -->
    <string name="mode_changed">Theme changed</string>

    <!-- Title of a section of the customization where the user can select color override for icon. [CHAR LIMIT=30] -->
    <string name="themed_icon_title" msgid="4305612684940220645">Themed icons</string>
+5 −1
Original line number Diff line number Diff line
@@ -128,7 +128,11 @@ public class DarkModeSectionController implements
        UiModeManager uiModeManager = context.getSystemService(UiModeManager.class);
        int shortDelay = context.getResources().getInteger(android.R.integer.config_shortAnimTime);
        new Handler(Looper.getMainLooper()).postDelayed(
                () -> uiModeManager.setNightModeActivated(viewActivated),
                () -> {
                    mDarkModeSectionView.announceForAccessibility(
                            context.getString(R.string.mode_changed));
                    uiModeManager.setNightModeActivated(viewActivated);
                },
                /* delayMillis= */ shortDelay);
    }