A sample Android application to demonstrate how to build screens as fully independant modules.
It relies on a Finite State Machine (EasyFlow), to handle screen as states and trigger/consume events. Events allows the application to handle navigation between screens. The global context used by the FSM is used to pass arguments as a Bundle. It also shows how to use dependency injection (via Dagger 2 for example) in modules.
This way:
- modules are fully independent
- modules declare the dependencies they need
- modules declare the states they correspond to
- modules declare the events that can be triggered
- the hosting application set up the states it uses (i.e., "screens")
- the hosting application set up how to navigation between states (with events)
- the hosting application set up the dependency injection mechanism
from The Android Arsenal
No comments:
Post a Comment