Fix dark mode detection when user setting is based on schedule - #9400
Merged
lmac012 merged 1 commit intoAug 6, 2026
Merged
Conversation
DuckDuckGoActivity.isDarkThemeEnabled() resolved SYSTEM_DEFAULT via the UiModeManager.nightMode setting, which only reports MODE_NIGHT_YES when dark theme is toggled on manually. When dark theme is activated by a schedule (sunset-to-sunrise or custom time, reported as AUTO/CUSTOM) or by battery saver, the check returned false while the app rendered dark, so enableEdgeToEdge() applied light system bars and status bar icons turned black on the dark UI. Resolve SYSTEM_DEFAULT from the configuration's current uiMode instead (isInNightMode()), the same source applyTheme() uses, and apply the same fix to the equivalent checks in InitialFeedbackFragment and the internal AppComponentsActivity. Fixes #9370 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
joshliebe
approved these changes
Aug 6, 2026
joshliebe
left a comment
Contributor
There was a problem hiding this comment.
Tested, works as expected now. Thanks for fixing it 🙂
lmac012
deleted the
fix/lukasz/detect-dark-mode-when-schedule-is-enabled
branch
August 6, 2026 13:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1217187293280095?focus=true
Tech Design URL (if applicable):
API Proposals URL(s) (if applicable):
Description
When the app theme is "System default",
isDarkThemeEnabled()read theUiModeManager.nightModesetting, which only reportsMODE_NIGHT_YESfor a manual toggle — a scheduled dark theme (sunset/custom/bedtime) or battery saver reportsAUTO/CUSTOMand was treated as light.enableEdgeToEdge()then applied light system bars on a dark UI, making status bar icons black. Now resolves night mode from the configuration'suiMode(isInNightMode()), the same sourceapplyTheme()uses. Same fix applied to the equivalent checks inInitialFeedbackFragmentand the internalAppComponentsActivity.Fixes #9370.
Steps to test this PR
Prerequisites - both should be met by default, but confirm just in case
edgeToEdgefeature flag is enabledUI elements matching scheduled dark theme
No regression with manual toggle
UI changes
Note
Low Risk
Localized theming and system-bar styling changes with no auth, data, or security impact; behavior should better match OS scheduled dark mode.
Overview
When the app theme is System default, dark/light decisions for edge-to-edge system bars and feedback button assets no longer use
UiModeManager.nightMode, which only reflects a manual OS dark toggle and misreports scheduled or battery-saver dark mode as light.DuckDuckGoActivity.isDarkThemeEnabled(),AppComponentsActivity, andInitialFeedbackFragmentnow useisInNightMode()(configurationuiMode) forSYSTEM_DEFAULT, aligning withapplyTheme()so status bar icon styling and feedback imagery match the actual UI theme.Reviewed by Cursor Bugbot for commit 89673d2. Bugbot is set up for automated code reviews on this repo. Configure here.