-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix NavigationBar overlapping StatusBar when NavigationBar visibility changes #33359
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b5ecffd
Update ToolbarExtensions.cs
Vignesh-SF3580 65999db
Added testcase.
Vignesh-SF3580 442819c
added snapshots
Vignesh-SF3580 c8a3bcc
Update MauiWindowInsetListener.cs
Vignesh-SF3580 263b03d
Add PR review state file for #33359
PureWeen ad11f92
revert safe area changes and added pending snapshots.
Vignesh-SF3580 68726db
Delete pr-33359.md
kubaflo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+27.4 KB
...ndroid.Tests/snapshots/android/NavigationBarLayoutWithMixedHasNavigationBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific; | ||
| using TabbedPage = Microsoft.Maui.Controls.TabbedPage; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 33340, "NavigationBar overlaps StatusBar in TabbedPage", PlatformAffected.Android)] | ||
| public class Issue33340 : TabbedPage | ||
| { | ||
| public Issue33340() | ||
| { | ||
| this.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().SetToolbarPlacement(ToolbarPlacement.Bottom); | ||
| var page1 = new ContentPage { Title = "Page1", Content = new Label { Text = "Page 1" } }; | ||
| NavigationPage.SetHasNavigationBar(page1, false); | ||
| Children.Add(new NavigationPage(page1) { Title = "Tab1" }); | ||
|
|
||
| var page2 = new ContentPage { Title = "Page2", Content = new Label { Text = "Page 2" } }; | ||
| NavigationPage.SetHasNavigationBar(page2, false); | ||
| Children.Add(new NavigationPage(page2) { Title = "Tab2" }); | ||
|
|
||
| var page3 = new ContentPage { Title = "Page3", Content = new Label { Text = "Page 3" } }; | ||
| NavigationPage.SetHasNavigationBar(page3, false); | ||
| Children.Add(new NavigationPage(page3) { Title = "Tab3" }); | ||
|
|
||
| var page4 = new ContentPage { Title = "Page4", Content = new Label { Text = "Page 4 with NavigationBar" } }; | ||
| NavigationPage.SetHasNavigationBar(page4, true); | ||
| Children.Add(new NavigationPage(page4) { Title = "Tab4" }); | ||
|
|
||
| CurrentPage = Children[0]; | ||
| } | ||
| } | ||
|
|
||
Binary file added
BIN
+11.2 KB
...tCases.Mac.Tests/snapshots/mac/NavigationBarLayoutWithMixedHasNavigationBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue33340.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue33340 : _IssuesUITest | ||
| { | ||
| public Issue33340(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "NavigationBar overlaps StatusBar in TabbedPage"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.TabbedPage)] | ||
| public void NavigationBarLayoutWithMixedHasNavigationBar() | ||
| { | ||
| App.WaitForElement("Tab4"); | ||
| App.Tap("Tab4"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } |
Binary file added
BIN
+8.71 KB
....WinUI.Tests/snapshots/windows/NavigationBarLayoutWithMixedHasNavigationBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67.3 KB
...tCases.iOS.Tests/snapshots/ios/NavigationBarLayoutWithMixedHasNavigationBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The UI test is missing AutomationId attributes on the tab buttons in the HostApp code. The test tries to interact with "Tab4" using
App.WaitForElement("Tab4")andApp.Tap("Tab4"), but the HostApp code does not set any AutomationId properties. While the tab Title is "Tab4", relying on Title text for UI automation is fragile and may not work reliably across platforms. Add AutomationId properties to the NavigationPage instances to ensure the test can reliably locate and interact with the tabs.