-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix AppBarLayout insets when FlyoutPage is pushed modally on Android #32379
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
Changes from all commits
b36cb2d
48d65c5
58ddc2c
b939889
8826a64
3e675da
88707e6
7348643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 32277, "When a FlyoutPage is pushed Modally it doesn't inset the AppBarLayout", PlatformAffected.Android)] | ||
| public partial class Issue32277 : NavigationPage | ||
| { | ||
| public Issue32277() | ||
| { | ||
| PushAsync(new Issue32277_ContentPage()); | ||
| } | ||
| } | ||
|
|
||
| public class Issue32277_ContentPage : ContentPage | ||
| { | ||
| public Issue32277_ContentPage() | ||
| { | ||
| Title = "Issue 32277"; | ||
|
|
||
| Button button = new Button | ||
| { | ||
| Text = "Push Modal Flyout Page", | ||
| AutomationId = "PushModalFlyoutButton" | ||
| }; | ||
| button.Clicked += async (s, e) => | ||
| { | ||
| await Navigation.PushModalAsync(new Issue32277_FlyoutPage()); | ||
| }; | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| button | ||
| } | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| public class Issue32277_FlyoutPage : FlyoutPage | ||
| { | ||
| public Issue32277_FlyoutPage() | ||
| { | ||
| Flyout = new ContentPage | ||
| { | ||
| Title = "Flyout", | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "This is the flyout page.", | ||
| AutomationId = "FlyoutLabel" | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| Detail = new NavigationPage(new ContentPage | ||
| { | ||
| Title = "Detail", | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "This is the detail page.", | ||
| AutomationId = "DetailLabel" | ||
| } | ||
| } | ||
| } | ||
| }); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #if ANDROID || IOS // Exclude desktop platforms (Windows, MacCatalyst) | ||
|
||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue32277 : _IssuesUITest | ||
| { | ||
| public Issue32277(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "When a FlyoutPage is pushed Modally it doesn't inset the AppBarLayout"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.FlyoutPage)] | ||
| public void FlyoutPageModalAppBarLayoutGetsInsets() | ||
| { | ||
| // Tap the button to push the FlyoutPage modally | ||
| App.WaitForElement("PushModalFlyoutButton"); | ||
| App.Tap("PushModalFlyoutButton"); | ||
|
|
||
| // Wait for the modal FlyoutPage to appear | ||
| App.WaitForElement("DetailLabel"); | ||
|
|
||
| // Verify the detail page is visible and properly positioned | ||
| // If the AppBarLayout insets are not applied correctly, the navigation bar | ||
| // would render behind system UI elements | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
| #endif | ||
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.
@copilot , replace
App.WaitForElement("DetailLabel", "Detail page should be visible with proper insets");withVerifyScreenshot().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.
Updated in e3adbcc. Replaced
App.WaitForElement("DetailLabel", "Detail page should be visible with proper insets")withVerifyScreenshot()for visual verification of proper AppBarLayout insets.