0

How can I disable/change the fading animation when using Navigation component together with BottomNavigationView?

My code to set them up together (in the activity) is as follows:

    private fun setupBottomNavMenu() {
        val navController = Navigation.findNavController(this, R.id.main_navigation_fragment)
        val bottomNavigation = findViewById<BottomNavigationView>(R.id.bottom_navigation)
        NavigationUI.setupWithNavController(bottomNavigation, navController)
    }
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
SnuKies
  • 1,578
  • 1
  • 16
  • 37

1 Answers1

-2

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>