Loading res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -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> Loading src/com/android/customization/model/mode/DarkModeSectionController.java +5 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading Loading
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
src/com/android/customization/model/mode/DarkModeSectionController.java +5 −1 Original line number Diff line number Diff line Loading @@ -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); } Loading