Fix the me icon tint color in dark mode - #21932
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a UI glitch where the "Me" icon in the navigation bar was displayed with the wrong tint in dark mode.
- Updated ImageManager.load() to accept an optional requestListener parameter for additional Glide handling.
- Introduced a gravatarLoaded flag and adjusted the color filter logic in WPMainNavigationView to conditionally update the icon tint only when a gravatar image is loaded.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| WordPress/src/main/java/org/wordpress/android/util/image/ImageManager.kt | Added a new parameter to the load() function and chained .attachRequestListener(requestListener) in the Glide configuration. |
| WordPress/src/main/java/org/wordpress/android/ui/main/WPMainNavigationView.kt | Introduced a gravatarLoaded flag and updated the setImageViewSelected method to only change the saturation when the gravatar image is loaded. |
Comments suppressed due to low confidence (1)
WordPress/src/main/java/org/wordpress/android/util/image/ImageManager.kt:457
- Ensure that attachRequestListener handles a null requestListener appropriately or add a null check if necessary to prevent potential runtime issues.
.attachRequestListener(requestListener)
| getImageViewForPosition(position)?.let { | ||
| if(position == getPosition(ME)) { | ||
| if(!isSelected){ | ||
| // Only change the saturation if we have loaded a Gravatar image |
There was a problem hiding this comment.
[nitpick] Consider adding inline documentation or clarifying the logic behind applying color filters only when gravatarLoaded is true to improve code maintainability.
| // Only change the saturation if we have loaded a Gravatar image | |
| // Only change the saturation if we have loaded a Gravatar image | |
| // Apply color filters only for the "ME" position and only if the Gravatar image has been loaded. | |
| // This ensures that the color filters are applied to the user's profile image (Gravatar) and not to other icons. |
Generated by 🚫 Danger |
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr21932-9fb12e8 | |
| Commit | 9fb12e8 | |
| Direct Download | wordpress-prototype-build-pr21932-9fb12e8.apk |
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr21932-9fb12e8 | |
| Commit | 9fb12e8 | |
| Direct Download | jetpack-prototype-build-pr21932-9fb12e8.apk |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #21932 +/- ##
=======================================
Coverage 39.31% 39.31%
=======================================
Files 2139 2139
Lines 100443 100443
Branches 15417 15417
=======================================
Hits 39491 39491
Misses 57468 57468
Partials 3484 3484 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|





Description
This PR is fixing a UI glitch where the "Me" icon in the nav bar was drawn with the wrong tint.
The bug was introduced here, where we were swapping the avatar from colored to black and white. So, when the avatar is not ready yet, it was causing the default icon to be shown using the wrong color.
This fix has surfaced other side "bugs" that I'll ticket separately:
Testing instructions