TRUST-1963 (bug fix) - Fix blank banner on light/dark mode switch#33
Merged
Conversation
Override onConfigurationChanged in BannerDialog to reapply all color resources when the UI mode changes. Previously, colors set in onCreateView would become stale when the system switched between light and dark mode, causing text and background to render as the same color. The fix adds reapplyColors() to refresh the close button color and re-render the current layer, plus a helper method to recursively update background colors throughout the view hierarchy.
lucasv-dg
approved these changes
Jun 24, 2026
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.
Jira Ticket
https://datagrail.atlassian.net/browse/TRUST-1963
Summary
When a user switches between light and dark mode on their device while the consent banner is open, the banner content may appear blank because text and background colors become mismatched (e.g., dark text on dark background). This happens because colors are applied programmatically in
onCreateView, but the Fragment's view is not re-created when the configuration changes.This PR fixes the issue by overriding
onConfigurationChangedto detect theme changes and reapply all color resources to existing views, ensuring the banner remains readable regardless of when the user switches themes.Key Changes
onConfigurationChangedinBannerDialogto detect UI mode changesreapplyColors()method to refresh close button color and re-render the current layerreapplyColorsRecursively()helper to update background colors throughout the view hierarchyandroid.content.res.Configurationfor configuration change detectionChecklist