Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Jetpack Navigation System Transition

In the Android Jetpack navigation component at for instance at here. I was wondering if it were possible to use default system animations (for instance the animation when starting a new activity) when screens change. This would be in the context of the enterAnim and the exitAnim parameters.

like image 519
Anthony Dito Avatar asked Jun 01 '18 21:06

Anthony Dito


1 Answers

When you're using the editor you can define the animation for the enter and exit transitions:

enter image description here

And if you don't have any animations defined in the anim xml folder there are some default animations available. If none of those is good enough for you, you can simply create a transition that mimics the default ones and set it there.

To get the default animations you need to have the dependence:

implementation "android.arch.navigation:navigation-ui-ktx:1.0.0-alpha01"
like image 133
Levi Moreira Avatar answered Sep 19 '22 12:09

Levi Moreira