Presenting data in multiple modules
In this section, we will look at how we can separate the presentation layer into multiple modules, how we can handle the interaction between these modules, and how they can share the same data.
When developing Android applications, we can group screens into different modules. For example, we can group a login or registration flow inside a library module called authentication, or if we have a settings section, we can group those screens inside a separate module. Sometimes these screens will have commonalities with the rest of the application, such as using the same loading progress bar or the same error mechanism. Other times, these screens must navigate to screens from other modules. The question we now need to ask is how this can happen without creating a dependency between the two modules or other modules that are on the same level. Having a direct dependency on these modules will risk creating a cyclic dependency as shown here: