forma
forma copied to clipboard
New navigation system
Our sample uses Jetpack Navigation. It brought some strong dependencies through whole project, such as
HomeFragment.kt
...
val navController = viewBinding.bottomNavigation.setupWithNavController(
navGraphIds = navGraphIds,
fragmentManager = childFragmentManager,
containerId = R.id.nav_host_container,
intent = requireActivity().intent
)
or codegen into
CharactersListFragment.kt
...
is CharactersListViewEvent.OpenCharacterDetail ->
findNavController().navigate(
CharactersListFragmentDirections
.actionCharactersListFragmentToCharacterDetailFragment(viewEvent.id))
It's not good decision without scalable points for projects "under Forma". And we think that will be good have some abstraction navigation layer, which will protect project structure, architecture from navigation tools dependencies, especially codegen from Navigation component.
That's why need to create own navigation system, which will be use by app presentation layer. May be after, we will think about additional navigation targets for Forma.
See here, some mind ideas how it may be look
It's better to BackTo
have field Class<Destination>
instead of Destination
. In that case you have no need to create such Destination
with it's explicit params when you just want to go back.
Maybe we can use cicerone? In our project we use cicerone and one more navigation abstraction for controlling screens flow