Skip to content

Instantly share code, notes, and snippets.

@DDihanov
Created December 4, 2020 14:31
Show Gist options
  • Save DDihanov/9fb7aadedc93304c9b0f49a5cb80ab14 to your computer and use it in GitHub Desktop.
Save DDihanov/9fb7aadedc93304c9b0f49a5cb80ab14 to your computer and use it in GitHub Desktop.
class MainActivity : AppCompatActivity(), ToFlowNavigatable {
private val navigator: Navigator = Navigator()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val navView: BottomNavigationView = findViewById(R.id.nav_view)
val navController = findNavController(R.id.nav_host_fragment)
navigator.navController = navController
navView.setupWithNavController(navController)
}
override fun navigateToFlow(flow: NavigationFlow) {
navigator.navigateToFlow(flow)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment