Skip to content

Instantly share code, notes, and snippets.

@wajahatkarim3
Created January 12, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wajahatkarim3/dc3e1acc1965d0a3d5f91d7c41fee3a8 to your computer and use it in GitHub Desktop.
Save wajahatkarim3/dc3e1acc1965d0a3d5f91d7c41fee3a8 to your computer and use it in GitHub Desktop.
fun setupViews()
{
// Finding the Navigation Controller
var navController = findNavController(R.id.fragNavHost)
// Setting Navigation Controller with the BottomNavigationView
bottomNavView.setupWithNavController(navController)
// Setting Up ActionBar with Navigation Controller
// Pass the IDs of top-level destinations in AppBarConfiguration
var appBarConfiguration = AppBarConfiguration(
topLevelDestinationIds = setOf (
R.id.homeFragment,
R.id.searchFragment,
R.id.notificationsFragment,
R.id.profileFragment
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment