Architecture-components-samples: [Navigation Component] I can`t change animation from NavigationUI.setupWithNavController()

Created on 16 Jan 2019  路  1Comment  路  Source: android/architecture-components-samples

call NavigationUI.setupWithNavController(bottomNavigationView, navController)
default fade in/out animation.

But, I want remove animation or change animation.

help me.

Most helpful comment

Add anim default files, you can change animation.

  • res/anim/nav_default_enter_anim.xml
  • res/anim/nav_default_exit_anim.xml
  • res/anim/nav_default_pop_enter_anim.xml
  • res/anim/nav_default_pop_exit_anim.xml

Like a below, disable animation.

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
</set>

Ref: https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/navigation/ui/src/main/res/anim/

>All comments

Add anim default files, you can change animation.

  • res/anim/nav_default_enter_anim.xml
  • res/anim/nav_default_exit_anim.xml
  • res/anim/nav_default_pop_enter_anim.xml
  • res/anim/nav_default_pop_exit_anim.xml

Like a below, disable animation.

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
</set>

Ref: https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/navigation/ui/src/main/res/anim/

Was this page helpful?
0 / 5 - 0 ratings