-
Notifications
You must be signed in to change notification settings - Fork 2k
Fixed SafeAreaEdges cannot be set for Shell and the flyout menu collides with display notch and status bar in landscape mode #32295
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6d6f263
Fixed 32275
NirmalKumarYuvaraj 8f4295b
more changes
NirmalKumarYuvaraj 612a7a1
updated changes
NirmalKumarYuvaraj 8aa9ec6
test case changes
NirmalKumarYuvaraj 6aaeec1
Fixed test case failure
NirmalKumarYuvaraj 67e5c8c
Modified test case
NirmalKumarYuvaraj 8f41efd
Fixed test case failures
NirmalKumarYuvaraj 75bb4e2
rebase changes
NirmalKumarYuvaraj 3b53f0b
Fixed FlyoutContentTemplate scenario
NirmalKumarYuvaraj 5cfe7af
Added template test scenario
NirmalKumarYuvaraj 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
+24.7 KB
...s.Android.Tests/snapshots/android-notch-36/ShellFlyoutShouldRespectSafeArea.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
+23.7 KB
.../TestCases.Android.Tests/snapshots/android/ShellFlyoutShouldRespectSafeArea.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 modified
BIN
+30.4 KB
(130%)
.../TestCases.Android.Tests/snapshots/android/ShouldFlyoutTextWrapsInLandscape.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 modified
BIN
-720 Bytes
(100%)
.../TestCases.Android.Tests/snapshots/android/VerifyShellFlyoutBackgroundImage.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,42 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 32275, "[NET10] SafeAreaEdges cannot be set for Shell and the flyout menu collides with display notch and status bar in landscape mode", PlatformAffected.Android)] | ||
| public class Issue32275 : TestShell | ||
| { | ||
| protected override void Init() | ||
| { | ||
| FlyoutBehavior = FlyoutBehavior.Flyout; | ||
|
|
||
| for (int i = 0; i < 10; i++) | ||
| { | ||
| Items.Add(new FlyoutItem | ||
| { | ||
| Title = "Issue 32275", | ||
| Items = | ||
| { | ||
| new ShellContent | ||
| { | ||
| Content = new Issue32275ContentPage(), | ||
| } | ||
| } | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| public class Issue32275ContentPage : TestContentPage | ||
| { | ||
| protected override void Init() | ||
| { | ||
| Title = "Issue 32275"; | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| new Label { AutomationId = "Issue32275Label", Text = "Open the flyout menu in landscape mode on a device with a display notch or status bar. The flyout menu should not collide with the notch or status bar." } | ||
| } | ||
| }; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
49 changes: 49 additions & 0 deletions
49
src/Controls/tests/TestCases.HostApp/Issues/Issue32275_Template.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,49 @@ | ||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.None, 32275, "SafeAreaEdges should be handled by the FlyoutContentTemplate", PlatformAffected.Android)] | ||
| public class Issue32275_Template : TestShell | ||
| { | ||
| protected override void Init() | ||
| { | ||
| FlyoutBehavior = FlyoutBehavior.Flyout; | ||
|
|
||
| var page = new Issue32275_Template_ContentPage(); | ||
|
|
||
| AddFlyoutItem(page, "Flyout Item"); | ||
|
|
||
|
|
||
| FlyoutContentTemplate = new DataTemplate(() => | ||
| { | ||
| var stackLayout = new StackLayout() { BackgroundColor = Colors.Gray, SafeAreaEdges = SafeAreaEdges.All }; | ||
|
|
||
| for (int i = 0; i < 50; i++) | ||
| { | ||
| var label = new Label | ||
| { | ||
| Text = $"Flyout Item {i + 1}", | ||
| FontSize = 24, | ||
| }; | ||
|
|
||
| stackLayout.Children.Add(label); | ||
| } | ||
| return stackLayout; | ||
| }); | ||
| } | ||
|
|
||
| public class Issue32275_Template_ContentPage : TestContentPage | ||
| { | ||
| protected override void Init() | ||
| { | ||
| Title = "Issue 32275"; | ||
| Content = new StackLayout | ||
| { | ||
| Children = | ||
| { | ||
| new Label { AutomationId = "Issue32275_Template_Label", Text = "Open the flyout menu in landscape mode on a device with a display notch or status bar. The flyout menu should not collide with the notch or status bar. The default SafeAreaPadding should not be applied. It should be handled by the template itself." } | ||
| } | ||
| }; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
30 changes: 30 additions & 0 deletions
30
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32275.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,30 @@ | ||
| #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Ignore file for Catalyst and Windows platforms. This test is applicable for mobile platforms only. | ||
|
PureWeen marked this conversation as resolved.
|
||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue32275 : _IssuesUITest | ||
| { | ||
| public Issue32275(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "[NET10] SafeAreaEdges cannot be set for Shell and the flyout menu collides with display notch and status bar in landscape mode"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.SafeAreaEdges)] | ||
| public void ShellFlyoutShouldRespectSafeArea() | ||
|
jsuarezruiz marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is failing on iOS: |
||
| { | ||
| App.WaitForElement("Issue32275Label"); | ||
| App.SetOrientationLandscape(); | ||
| App.TapShellFlyoutIcon(); | ||
| #if ANDROID | ||
| VerifyScreenshot(cropLeft: 125); | ||
| #else | ||
| VerifyScreenshot(); | ||
| #endif | ||
| } | ||
| } | ||
| #endif | ||
31 changes: 31 additions & 0 deletions
31
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue32275_Template.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,31 @@ | ||
| #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS // Ignore file for Catalyst and Windows platforms. This test is applicable for mobile platforms only. | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue32275_Template : _IssuesUITest | ||
| { | ||
| public Issue32275_Template(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "SafeAreaEdges should be handled by the FlyoutContentTemplate"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.SafeAreaEdges)] | ||
| public void ShellFlyoutContentTemplateShouldRespectSafeArea() | ||
| { | ||
| App.WaitForElement("Issue32275_Template_Label"); | ||
| App.TapShellFlyoutIcon(); | ||
| App.SetOrientationLandscape(); | ||
| Thread.Sleep(1000); // Allow time for orientation change to take effect and UI to stabilize. | ||
| #if ANDROID | ||
| VerifyScreenshot(cropLeft: 125); | ||
| #else | ||
| VerifyScreenshot(); | ||
| #endif | ||
| } | ||
| } | ||
| #endif |
Binary file added
BIN
+27.9 KB
...ls/tests/TestCases.iOS.Tests/snapshots/ios/ShellFlyoutShouldRespectSafeArea.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.
is this screen shot correct? should there be this much space between the navigation bar and the flyout items?
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.
Yes @PureWeen , If the flyout items contains images or icons, they would render fine.