terrakok / Cicerone

🚦 Cicerone is a lightweight library that makes the navigation in an Android app easy.
Other
2.58k stars 218 forks source link

Question: How to get nextFragment when moving backward? #153

Open FirstSpectr opened 3 years ago

FirstSpectr commented 3 years ago

I have an activity with toolbar, navigation drawer and container. So in navigator I did this:

override fun setupFragmentTransaction(nextFragment: Fragment) {
  when (nextFragment) {
    is SettingsFragment -> {
      binding.toolbar.setTitle(R.string.title_settings)
      binding.navigationView.setCheckedItem(R.id.nav_settings)
    }
  }
}

But this method not called when I call router.exit(). How can I figure out which screen will be shown?