'How to set animation in Navigation component without using action

I want to set an enter animation when navigating after splash finished.I am showing splash with style and when splash finished I am changing theme. (I may be following the wrong strategy for start application.) My app has one activity and N fragment. Here is my after splash finished code;

   if(token == null || token.length == 0){
        navHostFragment.navController.navigate(R.id.loginFragment,null, navOptions {
            this.anim {
                this.popEnter = R.anim.slide_down
                this.enter = R.anim.slide_down
            }
        })
    }else {
        navHostFragment.navController.navigate(R.id.anasayfaFragment)
    }

But in this way, animation is not starting? Whay it can't?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source