This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invoke AnimationFinished from fragment if no animation has been added (…
- Loading branch information
Showing
5 changed files
with
117 additions
and
6 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
78 changes: 78 additions & 0 deletions
78
....Issues/Xamarin.Forms.Controls.Issues.Shared/ShellWithCustomRendererDisabledAnimations.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,78 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 0, "[Shell] Overriding animation with custom renderer to remove animation breaks next navigation", | ||
PlatformAffected.All)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
#endif | ||
public class ShellWithCustomRendererDisabledAnimations : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
ContentPage contentPage = new ContentPage(); | ||
base.AddFlyoutItem(contentPage, "Root"); | ||
|
||
contentPage.Content = new Button() | ||
{ | ||
Text = "Click Me", | ||
AutomationId = "PageLoaded", | ||
Command = new Command(async () => | ||
{ | ||
await Navigation.PushAsync(CreateSecondPage()); | ||
}) | ||
}; | ||
} | ||
|
||
ContentPage CreateSecondPage() | ||
{ | ||
ContentPage page = new ContentPage(); | ||
|
||
page.Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "If clicking `Go Back` goes back to previous page then test has passed" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Go Back", | ||
Command = new Command(async () => | ||
{ | ||
await GoToAsync(".."); | ||
}), | ||
AutomationId = "GoBack" | ||
} | ||
} | ||
}; | ||
|
||
return page; | ||
} | ||
|
||
#if UITEST && __ANDROID__ | ||
[Test] | ||
public void NavigationWithACustomRendererThatDoesntSetAnAnimationStillWorks() | ||
{ | ||
RunningApp.Tap("PageLoaded"); | ||
RunningApp.Tap("GoBack"); | ||
RunningApp.WaitForElement("PageLoaded"); | ||
} | ||
#endif | ||
} | ||
} |
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