How do I define default animations for Navigation Actions?

前端 未结 3 769
情话喂你
情话喂你 2020-12-24 01:32

I\'m using Android Studio 3.2 Canary 14 and The Navigation Architecture Component. With this you can define transition animations pretty much as you would when using Intents

3条回答
  •  清歌不尽
    2020-12-24 02:15

    As said, R.anim has the default animations defined:

    • nav_default_enter_anim

    • nav_default_exit_anim

    • nav_default_pop_enter_anim

    • nav_default_pop_exit_anim

    But you can easily override them.

    Just create your own four anim resources with the same names in your app module (just to clarify, the id of one of them is your.package.name.R.anim.nav_default_enter_anim) and write what animation you'd like.

提交回复
热议问题