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

How to hook up with navController? #26

Closed
rubek-joshi opened this issue Mar 11, 2020 · 2 comments
Closed

How to hook up with navController? #26

rubek-joshi opened this issue Mar 11, 2020 · 2 comments

Comments

@rubek-joshi
Copy link

I am a newbie and am currently working with a single activity and multiple fragments pattern. I want to integrate this smooth bar with the navController.

I tried doing this:

bottomBar.onItemSelected = {
            when (it) {
                0 -> navController.navigate(R.id.someFragment)
                1 -> navController.navigate(R.id.someOtherFragment)
                else -> navController.navigate(R.id.someFragment)
            }
        }

But this would create a new fragment every time instead of using the existing fragment in the navigation stack. I looked up the documentation and it only teaches how to integrate it with the bottom navigation view they provided.

Is it possible to somehow setup the nav controller? And if not, are there any workarounds?

@jeluchu
Copy link

jeluchu commented Apr 17, 2020

I have exactly the same problem, I'm trying to apply the Navigation Controller to my project and it does not allow me to add it to this type of component

This is the error it gives me, it tells me that it is not a Bottom Navigation View and I require that

Thank you very much

Regards!

@ibrahimsn98
Copy link
Owner

Thank you @mayokunthefirst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants