-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 use navigation components with multi-Module application and BottomNavigationView #663
Comments
@LLin233 You can create a module "navigation" and move your graph(s) there. All your feature modules can take that navigation as dependency in order to access the safeArgs (if you are using them) and the actions. |
@LLin233 check my sample https://github.com/hamedsilver/ArchApp |
@damienlo is this method still the preferred way? or any other better options are available now? |
as an addition to @damienlo fix, you can do a "gradle hack" to share the resources between the navigation module and the app module (assuming it has access to all feature modules), this way the fragment names won't be highlighted as red.
|
If I remember well this hack is not "working" anymore with the rendent versions of Android Studio. But in our project we end up using a symbolic link to duplicate the file in both modules. |
@eyal-lezmy weird, it is working correctly on our project, using the latest version of navigation component library and android studio 4.1.1. |
@engi2nee Can you explaine what does it do? |
damienlo I created navigation module and move all nav graphs there. Yes compilation it's ok but it gives runtime error like this:
Android Studio Flamingo 2022.2.1 Patch 2 |
https://stackoverflow.com/questions/54616996/android-navigation-component-and-bottomnavigationview-in-a-multi-module-application
I am facing extract same circumstance here... trying to create a multi-module application where every feature is a standalone library (module). Single activity pattern is applied throughout the project, created different navGraphs for different modules and included them in app's navGraph, but can't make it work.
could anyone give me some ideas? Thank you!
The text was updated successfully, but these errors were encountered: