Fix header overlay darkness on API 11 and lower #110
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes header overlay darkness on Android API 11 and lower by adjusting the alpha overlay and introduces proper status bar appearance management across screens. The main changes address blur functionality limitations on older Android versions and ensure consistent UI theming.
- Increased overlay alpha from 0.15f to 0.6f for API < 32 to compensate for missing blur effect
- Added a new
Screencomponent to manage status bar appearance consistently across the app - Fixed theme inheritance issues in popup menus by wrapping components with appropriate theme providers
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| BlurredHeaderBackground.kt | Adjusts overlay alpha based on Android API level to compensate for blur limitations |
| Screen.kt | New component for managing status bar appearance across screens |
| LoginScreen.kt | Wraps content with Screen component using default status bar appearance |
| ProfileScreen.kt | Wraps content with Screen component forcing light status bars to false |
| ShareScreen.kt | Wraps content with Screen component forcing light status bars to false |
| GravatarScreen.kt | Wraps content with Screen component forcing light status bars to false |
| GravatarHeader.kt | Wraps header content with dark theme to ensure consistent appearance |
| ShareHeader.kt | Wraps header content with dark theme to ensure consistent appearance |
| TopBarPickerPopup.kt | Wraps popup with GravatarTheme to prevent theme inheritance issues |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../main/kotlin/com/gravatar/app/homeUi/presentation/home/components/BlurredHeaderBackground.kt
Show resolved
Hide resolved
etoledom
left a comment
There was a problem hiding this comment.
Looking great!
I've seen the new light status bar and the correct color of the menu on the main menu.
I couldn't test the darkened header in the older API.
@pinarol - could you take a fast look at this one? I've run the on-demand build.
📲 You can test the changes from this Pull Request in Gravatar Android by scanning the QR code below to install the corresponding build.
|
0165dcd to
56afbdd
Compare

Description
The
.blurModifier we use to blur the header image works only on API 12 and higher. We have an additional overlay withColor.Black(alpha = 0.15f)but that wasn't enough without the blur. The first commit ba92a80 changes the alpha for Android 11 and lower.Why not blur on older APIs? I've left a comment about this here. We should be able to add this, but the ProfileHeader needs some adjustments to make it look nice.
This change made it more obvious that the status bar icons are not properly tinted. 019a796 commit fixes that by setting a proper status bar appearance. I create a new
Screencomponent that handles this logic, so each screen component should use this one as a wrapper now. This will come in handy for the Screen analytics events as well.Additionally, I've noticed that forcing a dark theme on the Profile header forces the dark theme on the
TopBarPickerPopupcomponent. This was fixed here as well.Testing Steps
LoginScreenshould set the appearance based on the device's color mode, the icons should change the color.