Use MAUI system chrome fix packages - #1
Conversation
Remove the Android status bar workaround and consume the PR package artifacts from a local package source.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Hi @jfversluis , i tested the update-for-maui-system-chrome branch. If i click the "Toggle App Theme" button (API 36 simulator) on then main page multiple times (around 20 clicks) the app crash:
|
|
@AlleSchonWeg OK, but, other than that, does it work? Does it work on the project you are looking at? |
I'm still testing. Give me some time ;) |
Refresh the local MAUI package artifacts to the latest PR build and add a button that reapplies the reporter's Android system bar override for comparison.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for testing and reporting those two follow-up issues. I updated the MAUI PR with fixes for both cases: dotnet/maui#35463 The repro PR has also been updated to consume the newer MAUI PR package artifacts:
What changed on the MAUI side:
About the status bar text/icon color: Android's API name is a little confusing. Setting With this repro, both configured bar colors are visually light:
So the updated MAUI behavior intentionally keeps dark status bar icons/text in both themes because that gives better contrast against those backgrounds. If an app specifically wants "dark app theme always uses white status bar icons," it can still override that explicitly with Android-specific code. To demonstrate that, I added an Apply Android Theme Override button to this repro. With the updated MAUI packages:
I also re-tested locally on
|
|
Two other things, which works with my original repro but not with this test branch. I don't know if this is releated:
Edit: Both works after commit: |
|
@AlleSchonWeg so just to be clear, with the latest version of this PR everything seems to work OK? |
Yes |
|
Thanks for the extra modal details. I was able to reproduce the modal-specific problem against the previous PR packages: when starting in dark mode, the modal I pushed an additional MAUI PR update for this: dotnet/maui#35463 now includes commit With that local patch applied to the repro package, I verified:
Once the updated MAUI PR build finishes, I’ll refresh this repro PR to consume the new packages so the modal behavior can be verified directly from this repo without the local patched package. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Updated this repro PR to package build I also re-tested the modal scenarios from this repo on the Android emulator with those packages installed:
For comparison, I reproduced the previous package behavior before this update: the modal could show white status icons/text on a light status bar area. This package refresh should make the repro PR reflect the current MAUI PR behavior. |
|
Can you please try the latest MAUI PR artifacts now? This repro PR is updated to package build For manual verification, this is what I expect you to see:
The important bit is that both repro bar colors are visually light, so MAUI should choose dark status bar icons/text for both colors regardless of whether app/system theme is dark or light. The Apply Android Theme Override button on the main page is intentionally activity-window-only. It can force the main activity status icon mode, but it should not be treated as a modal override because Android modals use a separate |
|
With 10.0.80-ci.pr35463.26268.16 it works on API 35/36. But with API 27 it is not working (My demo code (main branch) also works with API 27). I looked at your MAUI PR and i'm not sure if all these changes are needed. I suggest remove the background color item from appBarLayout. Or what is the reason to set this value when edge to edge is enabled? This would eliminate my workaround in styles.xml: <style name="MauiAppBarLayout" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
<item name="android:background">@android:color/transparent</item>
</style>Setting Have you read this article: https://proandroiddev.com/how-to-support-edge-to-edge-display-in-android-apps-part-i-0ab1adf5986f ? This is almost the same problem. Look at |
|
Thanks, this is helpful and not frustrating. The API split makes the remaining gap clear. I agree that I pushed another MAUI PR update for that: dotnet/maui#35463 now includes commit I don't want to remove the default The current repro PR packages still point to |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I refreshed this repro PR to the latest MAUI PR artifacts: This package build includes the API 27-29 follow-up from dotnet/maui#35463 ( I verified the refreshed packages on the emulator I have running here, which is API 35: modal opened from dark mode, modal theme toggle, and Android system theme changes all keep the expected dark status bar icons/text on the light bar colors. I do not currently have an API 27-29 emulator available locally, so your API 27/28/29 retest will be the important confirmation for that legacy path. |
|
Hi,
I think the sample includes almost everything, like a real world app. |
|
@AlleSchonWeg I pushed an update to dotnet/maui#35463 and left the MAUI PR as draft while we wait for artifact verification. I tested your sample with MAUI DevFlow against the updated PR build/local patched Microsoft.Maui.Controls.dll. The expected result I verified is that the status bar and Android navigation/gesture bar use the correct effective chrome color for the current page/theme:
I also created temporary x86_64 AVDs for the older API buckets mentioned in the issue/PR discussion (API 28, 30, and 34), verified the same scenarios, and deleted those AVDs afterward.
Could you please try the artifacts from the latest dotnet/maui#35463 build once they are available and confirm whether this now fixes the sample on your devices/emulators too? |
|
Hi @jfversluis , I tested also API 29 to 31 with 3 dot navigation. If CreateWindow is set to a NavigationPage with a normal ContentPage as root the 3 dot NavigationBar is black (dark system theme) or white (light system theme). When i navigate in the app and go back the colour changes: Init code: protected override Window CreateWindow(IActivationState? activationState)
{
var navigationPage = new NavigationPage(new StartPage());
navigationPage.SetAppThemeColor(NavigationPage.BackgroundColorProperty, Color.FromArgb("#BCCCDC"), Color.FromArgb("#72e09a"));
navigationPage.SetAppThemeColor(NavigationPage.BarBackgroundColorProperty, Color.FromArgb("#BCCCDC"), Color.FromArgb("#72e09a"));
return new Window(navigationPage);
} |
The "brush problem" is fixed! Thanks great work! We will also fix the remaining problems 💪 |
|
@AlleSchonWeg I pushed another update to dotnet/maui#35463 (27646a426c) and kept the MAUI PR as draft while waiting for artifact verification. This update does two things based on your latest comments:
I verified the updated local MAUI assemblies in your sample with MAUI DevFlow on a temporary Android API 30 x86_64 emulator with three-button navigation enabled, then deleted that emulator/SDK afterward. Sampled colors from the full-device screenshots:
Once the new PR artifacts are available, could you try this version against your repro/real app and confirm whether these two remaining issues are resolved? |
Use MAUI PR 35463 package artifacts from build 1446179 so the repro PR exercises the latest Android system chrome fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@AlleSchonWeg I refreshed this PR to use the latest MAUI PR 35463 package artifacts: The latest MAUI changes address the two follow-up points you raised:
I verified the refreshed packages with DevFlow on an API 30 x86_64 emulator using three-button navigation. The sampled status/navigation chrome colors matched the sample's expected values: light
MAUI PR 35463 is still draft while this is being verified. |
|
Hi,
|
|
I tested more. Also with the custom splashscreen demo. Ok. The new packages (10.0.80-ci.pr35463.26302.52) work 100 % from API 27 to 30. 👍 On API 31 and 34 to 36 the splashscreen has the wrong icon/text colour when system is in dark mode. I think it's because i need to set <?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="BackgroundDark">#72e09a</color>
<!--SplashScreen Colors Ende-->
</resources>I changed API.31.Splash.mp4With API 32 and 33 the behaviour is similar. Also when system is in dark mode. The icon/text colour are correct (white), then it flickers to dark and the white again. Demo: API.33.Splash.mp4Here is the demo app with custom splashscreen. |
|
Hi @jfversluis |
|
Hi @AlleSchonWeg, yes, still working on it. Thanks for the additional videos/sample. I pushed another update to dotnet/maui#35463:
New MAUI PR artifacts are pending from that latest commit. Once they are available, please try the newer artifacts instead of For the custom splashscreen sample: I inspected the attached project. In <item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>That asks Android for light/white system bar icons during the splash/post-splash theme. On a light background such as For that custom splash style, if you want dark icons on the light green splash background, try setting the night splash/post-splash theme to |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Updated this repro PR to the latest official MAUI PR artifacts from dotnet/maui#35463:
I also retested locally on the API 35 emulator with those exact packages. The modal scenario now behaves as expected:
One clarification on the status bar icon/color part: the MAUI fix intentionally makes the status/navigation bar background follow the MAUI navigation/tab/modal chrome more predictably, but it does not take over Android’s The latest MAUI CI pipelines are still running, but the official package artifact is available and this repro now uses it. |
|
Hi @jfversluis,
It happens if you click "TabbedPage with BarBackground Color" (navigate back and forth) or "TabbedPage with BarBackground Brush" I tested only API 35. Not sure if other APIs also affected. Edit: Same crash with API 29 |
|
Thanks for the crash log — I reproduced the disposed |
Refresh the local NuGet feed from dotnet/maui#35463 Azure build 1472310 PackageArtifacts and update the repro to consume the official packages that include the disposed AppBar background-state fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Updated this repro PR to the latest official dotnet/maui#35463 PackageArtifacts from Azure build |
|
Hi @jfversluis In the original repro app the statusbar text/icon colour in modal pages are resetting to default (white) after clicking "Apply Android Theme Override". This is not happening in my custom splash screen app.
Aufzeichnung.2026-06-19.154003.mp4Edit: With older package version f3c0cb4 the problem doesn't happen |
|
The custom splash screen demo app isn't working on my Pixel 9a.
It happens after clicking the "TabbedPage with ..." buttons. Emulator works. |
|
Thanks for retesting and for the video. I dug into this path with the current What I see is that the modal background chrome is still being set correctly ( I pushed a follow-up MAUI fix to dotnet/maui#35463 in commit I also added an Android regression test, |
Use the latest dotnet/maui#35463 PackageArtifacts from Azure build 1472685, including the modal system-bar foreground inheritance fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Updated this repro PR to the latest official dotnet/maui#35463 PackageArtifacts from Azure build
Local validation on the API 35 emulator with the exact sequence from the video:
Result: the modal opened with status bar + toolbar background still No CI note for the MAUI PR: the package-producing jobs for build |
|
@jfversluis can you test on a physical device? On my physical pixel phone the test app crashes as described above. |
|
I tested this on a physical Pixel 8 (Android 16 / API 36) as well. For the current repro app on
For the custom splash screen sample you attached: yes, that physical-device crash is the same AndroidX.Core issue as dotnet/maui#35584. After moving the sample to the latest I applied the temporary workaround from dotnet/maui#35584 locally to that custom sample and retested both The workaround I used was: #if ANDROID
RadioButtonSemanticsPatch.Apply();
#endif#if ANDROID
internal static class RadioButtonSemanticsPatch
{
internal static void Apply()
{
// Temporary workaround for dotnet/maui#35584. This disables MAUI's
// accessibility semantics mapper to avoid AndroidX.Core 1.17's
// missing set_Checked(bool) method, but it also breaks accessibility
// semantics while applied.
ViewHandler.ViewMapper.Add(nameof(IView.Semantics), static (_, _) => { });
}
}
#endifI did not add that workaround to this repro repo because this repro currently resolves |
|
I cherry-picked the merged #35584 fix onto the MAUI system-chrome PR branch and pushed it as I then built local overlay packages from that exact MAUI branch and tested on the physical Pixel 8 / Android 16 (API 36):
I have not pushed these locally built overlay packages into this repro PR as official artifacts. They were only used to verify the combined MAUI branch locally until CI produces fresh packages from the updated MAUI PR. |
|
Hi @jfversluis , I'm happy with the implemenation. Everything works. |
































Summary
nuget.configpointing atlocal-packagesplus NuGet.org.local-packages.Microsoft.Maui.Controlsto10.0.80-ci.pr35463.26265.21.Validation
net10.0-android.emulator-5554.#BCCCDC; dark status/app/nav bar#72E09A; modal top/app bar#72E09A.