-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Inheriting StatusBar and NavigationBar background colors on modal pages #28568
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
Conversation
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? |
db81225
to
bffb022
Compare
var statusBarColor = mainActivityWindow.StatusBarColor; | ||
#pragma warning disable CA1422 | ||
dialog.Window.SetNavigationBarColor(new AColor(navigationBarColor)); | ||
dialog.Window.SetStatusBarColor(new AColor(statusBarColor)); |
There was a problem hiding this comment.
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
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
[Test] | ||
[Category(UITestCategories.Navigation)] | ||
public void StatusBarAndNavigationBarShouldInheritColor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending snapshot already available in the latest build.
Could you commit it?
{ | ||
var navigationBarColor = mainActivityWindow.NavigationBarColor; | ||
var statusBarColor = mainActivityWindow.StatusBarColor; | ||
#pragma warning disable CA1422 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we detect API level and use SetSystemBarsAppearance
for API 30+?
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
For more information about inflight process check https://github.com/dotnet/maui/wiki/Inflight-Branch-Process # .NET MAUI Release Notes ## New Release: May 21, 2025 We're excited to announce a new release of .NET MAUI with several bug fixes and improvements across various platforms. ### Bug Fixes #### iOS - **Map Control**: Fixed crash when navigating to a page containing a map more than once (#29369) - **CarouselView**: Fixed bounce-back behavior when Loop=false, ensuring proper scrolling experience (#29318) - **UIView**: Fixed NullReferenceException for UIView not being in UIWindow (#29460) #### Windows - **CarouselView**: Fixed HorizontalScrollBarVisibility="Never" not working properly (#29343) - **UI Controls**: Fixed the color not being applied to the Expand/Collapse Chevron icon (#29140) #### Windows & macOS - **Modal Navigation**: Fixed issue where Disappearing event was not triggered when closing a window with a modal page (#29129) #### Android - **Modal Pages**: Improved inheritance of StatusBar and NavigationBar background colors (#28568) - **Footer Scrolling**: Fixed footer scrolling issues in list controls (#29381) - **Modal Pages**: Improved inheritance of StatusBar and NavigationBar background colors on modal pages (#28568) #### Cross-Platform - **CarouselView**: Fixed ItemsLayout runtime updates to ensure proper layout behavior (#29447) - **CollectionView**: Fixed various issues in CollectionView implementation (#29423) ### Testing Improvements - Added feature matrix UITest cases for CollectionView dynamic changes (#29424) ### Code Quality - Fixed code formatting issues across the codebase - Minor typo corrections (#29379) ### Contributors This release was made possible by the hard work of our dedicated team and community contributors. We'd like to extend our gratitude to everyone who has contributed to this release. ### Installation This update is available through NuGet and the .NET SDK. Update your projects to get access to these fixes. ### Known Issues Please refer to our issue tracker for any known issues and their workarounds. --- For more information about .NET MAUI, visit [the official documentation](https://docs.microsoft.com/dotnet/maui/).
… modal pages (#28568) * Inheriting StatusBar and NavigationBar background colors * Added snapshot
Issues Fixed
Fixes #28552
Screen.Recording.2025-03-23.at.14.45.34.mov
Screen.Recording.2025-03-23.at.14.44.26.mov