Maui
Maui copied to clipboard
[BUG] StatusBar.Android.PlatformSetColor() breaks ViewTreeObserver.IOnGlobalLayoutListener
Is there an existing issue for this?
- [x] I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
This PR https://github.com/CommunityToolkit/Maui/pull/1630 has broken ViewTreeObserver.IOnGlobalLayoutListener on Android API 29 and (protentional below).
var listener = new WindowInsetsOldApiListener(activity.Window.DecorView);
activity.Window.DecorView.RootView?.ViewTreeObserver?.AddOnGlobalLayoutListener(listener);
Expected Behavior
ViewTreeObserver.IOnGlobalLayoutListener works as before the PR https://github.com/CommunityToolkit/Maui/pull/1630
Environment
- .NET MAUI CommunityToolkit: 9.0.3 and 9.1.0
- OS: Windows
- .NET MAUI: .NET 8.0.91
Anything else?
Can't confirm which line of code in the PR has broken ViewTreeObserver.IOnGlobalLayoutListener. Also can't easily test the bug on Android emulators API 29 and below due to an old version of WebView on such emulators. I have a project using BlazorWebView. As I get more info I'll be back. What I can say for sure is reverting the PR https://github.com/CommunityToolkit/Maui/pull/1630 and using CommunityToolkit as a .dll makes ViewTreeObserver.IOnGlobalLayoutListener work normally.