Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New navigation system #46

Open
michaem opened this issue Dec 2, 2020 · 2 comments
Open

New navigation system #46

michaem opened this issue Dec 2, 2020 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@michaem
Copy link
Collaborator

michaem commented Dec 2, 2020

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
navigation

@michaem michaem added enhancement New feature or request help wanted Extra attention is needed labels Dec 2, 2020
@b1n0m13
Copy link

b1n0m13 commented Jan 6, 2021

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.

@ikarenkov
Copy link
Collaborator

Maybe we can use cicerone? In our project we use cicerone and one more navigation abstraction for controlling screens flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants