diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
index 079585280840..30b31f4b29fd 100644
--- a/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
+++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cs
@@ -183,7 +183,7 @@ protected virtual IShellBottomNavViewAppearanceTracker CreateBottomNavViewAppear
protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == Shell.CurrentItemProperty.PropertyName)
- SwitchFragment(FragmentManager, _frameLayout, Element.CurrentItem);
+ SwitchFragment(FragmentManager, _frameLayout, Element.CurrentItem, Element.IsAnimateOnNavigation);
_elementPropertyChanged?.Invoke(sender, e);
}
@@ -226,7 +226,14 @@ protected virtual void SwitchFragment(FragmentManager manager, AView targetView,
FragmentTransaction transaction = manager.BeginTransactionEx();
if (animate)
- transaction.SetTransitionEx((int)global::Android.App.FragmentTransit.FragmentOpen);
+ {
+ transaction.SetCustomAnimations(
+ global::Android.Resource.Animation.FadeIn,
+ global::Android.Resource.Animation.FadeOut,
+ global::Android.Resource.Animation.FadeIn,
+ global::Android.Resource.Animation.FadeOut
+ );
+ }
transaction.ReplaceEx(_frameLayout.Id, fragment);
diff --git a/src/Controls/src/Core/Shell/Shell.cs b/src/Controls/src/Core/Shell/Shell.cs
index a27b6fa366ed..3225dc0368e5 100644
--- a/src/Controls/src/Core/Shell/Shell.cs
+++ b/src/Controls/src/Core/Shell/Shell.cs
@@ -1035,6 +1035,7 @@ public Task GoToAsync(ShellNavigationState state)
///
public Task GoToAsync(ShellNavigationState state, bool animate)
{
+ IsAnimateOnNavigation = animate;
return _navigationManager.GoToAsync(state, animate, false);
}
@@ -1054,6 +1055,7 @@ public Task GoToAsync(ShellNavigationState state, IDictionary pa
/// A task that represents the asynchronous navigation operation.
public Task GoToAsync(ShellNavigationState state, bool animate, IDictionary parameters)
{
+ IsAnimateOnNavigation = animate;
return _navigationManager.GoToAsync(state, animate, false, parameters: new ShellRouteParameters(parameters));
}
@@ -1077,6 +1079,7 @@ public Task GoToAsync(ShellNavigationState state, ShellNavigationQueryParameters
///
public Task GoToAsync(ShellNavigationState state, bool animate, ShellNavigationQueryParameters shellNavigationQueryParameters)
{
+ IsAnimateOnNavigation = animate;
return _navigationManager.GoToAsync(state, animate, false, parameters: new ShellRouteParameters(shellNavigationQueryParameters));
}
@@ -1178,6 +1181,7 @@ public Task GoToAsync(ShellNavigationState state, bool animate, ShellNavigationQ
ShellNavigationManager _navigationManager;
ShellFlyoutItemsManager _flyoutManager;
Page _previousPage;
+ internal bool IsAnimateOnNavigation = true;
///
public Shell()