0

im using the AndroidX Navigation Library, it works like a charme so far. But im struggle to control when the "home as up" button gets shown on the toolbar/actionbar. Im using a BottomNavigation, so all items shown in it should not display "home as up".

How do i control this ?

Kitesurfer
  • 3,438
  • 2
  • 29
  • 47

1 Answers1

0

I looked a bit more, there is an feature i missed before, you'll need to define your top level destinations in code:

        val topLevelDestinations = setOf<Int>(
        R.id.nav_waste_calendar,
        R.id.nav_news,
        R.id.nav_waste_abc,
        R.id.nav_pois
    )
    val appBarConfiguration =
        AppBarConfiguration.Builder(topLevelDestinations).setDrawerLayout(drawer_layout).build()

    setupActionBarWithNavController(navController, appBarConfiguration)

Im not 100% sure why you have to do this in code and not declare those in your navigation/navigation.xml

cheers

Kitesurfer
  • 3,438
  • 2
  • 29
  • 47