-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix content page title clipping on Android API < 30 with window insets compatibility #32738
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
Co-authored-by: PureWeen <[email protected]>
|
@copilot can you please update the title and descripton to better reflect the changes |
Updated the PR title to "Fix Shell content page title clipping on Android API 28-29" and revised the description to better describe the actual changes and root cause. The description now focuses on what this PR accomplishes rather than framing it as a backport reference. |
Updated the PR title to "Fix content page title clipping on Android API < 30 with window insets compatibility" and description to match PR #32537, including the detailed explanation of affected Android versions (API < 30), affected scenarios (both Shell and NavigationPage), and the comprehensive technical details. |
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.
Pull Request Overview
This PR fixes Shell navigation page titles being clipped under the system UI on Android 9 (API 28) and Android 10 (API 29) by applying Google's AndroidX workaround for the insets dispatch bug in those API versions.
Key Changes
- Applies
ViewGroupCompat.InstallCompatInsetsDispatch()for Android API < 30 to ensure all children receive window insets - Adds null-checking and logging for cases where
_rootViewis null - Includes comprehensive UI test verifying Shell navigation title positioning across page navigation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Core/src/Platform/Android/Navigation/NavigationRootManager.cs |
Implements compat insets dispatch for API < 30 with proper null-checking and logging |
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32526.cs |
Adds NUnit test verifying Shell navigation page titles are not clipped |
src/Controls/tests/TestCases.HostApp/Issues/Issue32526.xaml.cs |
Provides test page implementation with Shell and navigation pages |
src/Controls/tests/TestCases.HostApp/Issues/Issue32526.xaml |
Defines Shell container for test pages |
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [Microsoft.Maui.Controls](https://github.com/dotnet/maui) | nuget | patch | `10.0.10` -> `10.0.11` | --- ### Release Notes <details> <summary>dotnet/maui (Microsoft.Maui.Controls)</summary> ### [`v10.0.11`](https://github.com/dotnet/maui/releases/tag/10.0.11): SR1.1 [Compare Source](dotnet/maui@10.0.10...10.0.11) ##### What's Changed .NET MAUI 10.0.11 introduces significant improvements across all platforms with focus on quality, performance, and developer experience. This release includes 11 commits with various improvements, bug fixes, and enhancements. ##### .NET MAUI Product Fixes ##### Android - Fix content page title clipping on Android API < 30 with window insets compatibility by [@​Copilot](https://github.com/Copilot) in dotnet/maui#32738 <details> <summary>🔧 Fixes</summary> - [Shell content page title position incorrect/clipped](dotnet/maui#32526) </details> ##### Button - \[release/10.0.1xx-sr1] Removed Value property coercion in RadioButton by [@​github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32604 <details> <summary>🔧 Fixes</summary> - [Removed Value property coercion in RadioButton](dotnet/maui#32489) </details> ##### DateTimePicker - Fix crash when TimePicker.Time is set to null (backport from PR [#​32660](dotnet/maui#32660)) by [@​Copilot](https://github.com/Copilot) in dotnet/maui#32715 <details> <summary>🔧 Fixes</summary> - [Fix crash when TimePicker.Time is set to null](dotnet/maui#32660) </details> ##### Gestures - \[release/10.0.1xx-sr1] predictive back gesture support for Android 13+ by [@​github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32635 <details> <summary>🔧 Fixes</summary> - [predictive back gesture support for Android 13+](dotnet/maui#32461) </details> ##### Infrastructure - \[release/10.0.1xx-sr1] \[ci] Revert changes setting Creator by [@​github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32803 <details> <summary>🔧 Fixes</summary> - [\[ci\] Revert changes setting Creator](dotnet/maui#32743) </details> ##### Mediapicker - \[release/10.0.1xx-sr1] \[Android] Refactor selection limit handling in MediaPicker by [@​github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#32628 <details> <summary>🔧 Fixes</summary> - [\[Android\] Refactor selection limit handling in MediaPicker](dotnet/maui#32571) ...
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Fix Window Insets on Android API < 30 (NavigationPage and Shell)
Description
This PR addresses window insets issues on Android versions below API 30 (Android 11) affecting both Shell and NavigationPage navigation. The fix implements Google's workaround for the inset dispatch bug present in Android API 28 and API 29.
Changes Made
1. NavigationRootManager.cs
Added
ViewGroupCompat.InstallCompatInsetsDispatch()for API < 30 to ensure window insets are properly dispatched to all children recursively. This implements Google's workaround for the inset dispatch bug where one child consuming insets blocks all siblings from receiving them.Issue: On Android API < 30, when one view consumes window insets, sibling views don't receive them, causing content to be clipped by system UI (status bar, navigation bar, etc.). This affects both Shell navigation and NavigationPage with hidden navigation bars.
Defensive Programming: Added null check and logging for
_rootViewto help with future debugging and prevent potential null reference exceptions. Uses_mauiContext?.CreateLogger()?.LogWarning()with the properMicrosoft.Extensions.Loggingusing directive for logging integration.2. Test Case (Issue32526)
Navigation.PushAsync()Affected Android Versions
Affected Scenarios
Issues Fixed
Fixes #32526
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.