forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] FlyoutIsPresented property opens the Flyout (dotnet#19807)
* Fix the issue * Added device test * Added sample * Added comment * - fix tests --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
- Loading branch information
1 parent
a36ceae
commit abe0025
Showing
4 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
35 changes: 35 additions & 0 deletions
35
src/Controls/tests/DeviceTests/Elements/Shell/ShellFlyoutTests.Android.cs
This file contains 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,35 @@ | ||
using AndroidX.DrawerLayout.Widget; | ||
using Microsoft.Maui.Controls; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace Microsoft.Maui.DeviceTests | ||
{ | ||
[Category(TestCategory.Shell)] | ||
public partial class ShellTests | ||
{ | ||
[Fact(DisplayName = "FlyoutIsPresented=true sets the visible status of the Shell Flyout.")] | ||
public async Task FlyoutIsPresentedOpenDrawer() | ||
{ | ||
await RunShellTest(shell => | ||
{ | ||
shell.FlyoutContent = new VerticalStackLayout() { new Label() { Text = "Flyout Content" } }; | ||
}, | ||
async (shell, handler) => | ||
{ | ||
// 1. Set FlyoutIsPresented=true to make the Shell Flyout visible. | ||
shell.FlyoutIsPresented = true; | ||
var dl = GetDrawerLayout(handler) as DrawerLayout; | ||
Assert.NotNull(dl); | ||
await AssertionExtensions.AssertEventually(() => | ||
{ | ||
// 2. Check that the Flyout has size. | ||
var flyoutFrame = GetFlyoutFrame(handler); | ||
return flyoutFrame.Width > 0 && flyoutFrame.Height > 0 && dl.IsOpen; | ||
}); | ||
}); | ||
} | ||
} | ||
} |