I have botton navation setup up as below and it works all right.
navController = findNavController(R.id.nav_host_fragment)
appBarConfiguration = AppBarConfiguration(setOf(R.id.nav_1, R.id.nav_2))
setupActionBarWithNavController(navController, appBarConfiguration)
binding.bottomNavView.setupWithNavController(navController)
Now I would like to prevent switching fragments if current fragment is the second one and it has some flag set in it.
I've tried using bottomNavView.setOnItemSelectedListener but it breaks the entire nav controller mechanism and requires doing fragment and title swithcing by yourself.
Is there any other way of overriding nav controller behaviour for a pariticular item and let it handle the rest as usual with something like super.onItemSelected()?