Navigating between fragments is easy to do, but it appears very sharp and does not provide a smooth user experience. We can improve this by adding transitions to the navigation.
When navigating between fragments, we can add an animation, or rather a transition to make the overall change seem less sharp and more appealing:
One of the simplest ways to add animations to transitions is to simply make use of the built-in animations, such as fade or open. This is set by calling the
SetTransition()
method:SupportFragmentManager .BeginTransaction() .SetTransition(FragmentTransaction.TransitFragmentOpen) .Replace(Resource.Id.fragmentContainer, content) .AddToBackStack(null) .Commit();
In order to create more fragment transitions, we have to create animations. This is a relatively straightforward process, but it does differ depending on the Android version we are supporting. Typically, we would create either two or four separate animations, for each...