title: Android Fragment Navigation Custom Navigation Back Button
body: <p>I need to navigate a stack of fragments and I am navigating back using the toolbar back button. Can I override the back button pressed to set a custom animation, for example slide out?</p>
  
  <p>Here is the code for the toolbar.</p>
  
  <pre><code>private fun setupToolbar() {
      val appBarConfiguration = AppBarConfiguration(navController.graph, drawer_layout)
      val toolbar = toolbar as Toolbar
      setSupportActionBar(toolbar)
      toolbar.setupWithNavController(navController, appBarConfiguration)
      val ab: ActionBar? = supportActionBar
      ab?.setDisplayShowTitleEnabled(false) // disable the default title element here (for centered title)
      setupSearchQueryListener()
  }
  </code></pre>