Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Inheriting StatusBar and NavigationBar background colors on modal pages #28568

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kubaflo
Copy link
Contributor

@kubaflo kubaflo commented Mar 23, 2025

Issues Fixed

Fixes #28552

Before After
Screen.Recording.2025-03-23.at.14.45.34.mov
Screen.Recording.2025-03-23.at.14.44.26.mov

@kubaflo kubaflo requested a review from a team as a code owner March 23, 2025 14:15
@kubaflo kubaflo self-assigned this Mar 23, 2025
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Mar 23, 2025
@pictos
Copy link
Contributor

pictos commented Mar 23, 2025

During the first implementation was a discussion of the Maui should handle that or not. I believe we chosen to not due to some edge cases. Do you remember @Redth?

@kubaflo kubaflo force-pushed the Changing-StatusBar-and-NavigationBar-background-color-doesn't-work-with-Modal-pages branch from db81225 to bffb022 Compare March 23, 2025 19:14
var statusBarColor = mainActivityWindow.StatusBarColor;
#pragma warning disable CA1422
dialog.Window.SetNavigationBarColor(new AColor(navigationBarColor));
dialog.Window.SetStatusBarColor(new AColor(statusBarColor));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking, should we maybe also take into account window.SetFlags just as it's done in here CommunityToolkit/Maui#2370 (comment) ?

But there are also other options for light/dark icons on status and navigation bar, visibility options etc.

Maybe that's why this issue was resolved the way it was using Community Toolkit?

That would also explain why there is a way to create your own implementation of this workaround to copy all the values needed https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/platform-specific/dialogfragment-customization#create-you-own-service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NET 9 regression] Changing StatusBar and NavigationBar background color doesn't work with Modal pages
3 participants