fix: dark status bar icons on light theme#24
Merged
wassupluke merged 1 commit intomainfrom Apr 3, 2026
Merged
Conversation
…t theme enableEdgeToEdge() with no args uses SystemBarStyle.auto() which follows the system dark mode, not the app theme — causing white icons on the app's light background when the device is in dark mode. Fixes #14
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsures the app always uses dark status bar icons on a light background by configuring edge-to-edge system bar styling in MainActivity and removing a redundant, now-unnecessary SideEffect-based status bar configuration from the app theme. Sequence diagram for app launch and updated system bar stylingsequenceDiagram
actor User
participant AndroidSystem
participant MainActivity
participant SystemBars
participant ComposeContent
User->>AndroidSystem: Tap app icon
AndroidSystem->>MainActivity: create Activity
MainActivity->>MainActivity: onCreate(savedInstanceState)
MainActivity->>MainActivity: enableEdgeToEdge(statusBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT))
MainActivity->>SystemBars: Apply light status bar style
SystemBars-->>MainActivity: Status bar icons set to dark
MainActivity->>ComposeContent: setContent { SimpleWeatherTheme { ... } }
ComposeContent-->>User: Render UI with light theme and dark status bar icons
Class diagram for MainActivity and SimpleWeatherTheme changesclassDiagram
class ComponentActivity
class MainActivity {
+onCreate(savedInstanceState: Bundle): void
+enableEdgeToEdge(statusBarStyle: SystemBarStyle): void
+viewModelFactory: ViewModelProvider.Factory
}
class SimpleWeatherTheme {
+SimpleWeatherTheme(content: ComposableFunction): void
}
class SystemBarStyle {
+light(statusBarColor: Int, navigationBarColor: Int): SystemBarStyle
}
class Color {
<<utility>>
+TRANSPARENT: Int
}
class ComposableFunction {
<<functional>>
}
MainActivity --|> ComponentActivity
MainActivity ..> SystemBarStyle : uses
MainActivity ..> Color : uses
MainActivity ..> SimpleWeatherTheme : sets content with
SimpleWeatherTheme ..> ComposableFunction : wraps content
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Using
SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT)hardcodes dark icons regardless of the actual content behind the status bar; consider basing icon appearance on the top surface/theme luminance so contrast remains acceptable on all screens. - You currently only override
statusBarStyleinenableEdgeToEdge; if the app uses a consistently light navigation bar as well, consider also settingnavigationBarStylefor visual consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Using `SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT)` hardcodes dark icons regardless of the actual content behind the status bar; consider basing icon appearance on the top surface/theme luminance so contrast remains acceptable on all screens.
- You currently only override `statusBarStyle` in `enableEdgeToEdge`; if the app uses a consistently light navigation bar as well, consider also setting `navigationBarStyle` for visual consistency.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Summary
enableEdgeToEdge()with no args usesSystemBarStyle.auto()which follows the system dark mode setting, causing white status bar icons on the app's light background when the device is in dark modeSystemBarStyle.light(TRANSPARENT, TRANSPARENT)to always use dark iconsSideEffectinSimpleWeatherThemethat was trying (and failing) to do the same thingFixes #14
Test plan
Summary by Sourcery
Ensure the app always uses dark status bar icons on its light theme regardless of system dark mode settings.
Bug Fixes:
Enhancements: