the application intended for training moxy and di applying in mvp-project
In this simple app we can see an implementation of the following tools:
- An architecture pattern providing code-modularity
-
Tool which hepls you use view state for considering different events with ui (e.g. screen rotation).
It saves presenter independly, whether any view is bound to it or not. And, furthermore, presenter interacts with view through view-interface.
You should do the following steps:
- Implement required libraries (app/build.gradle):
implementation 'com.arello-mobile:moxy:1.5.5'
implementation 'com.arello-mobile:moxy-app-compat:1.5.5'
kapt 'com.arello-mobile:moxy-compiler:1.5.5'
- Create View-interface implementing
MvpView
from moxy-library - Create presenter-class extending
MvpPresenter
- Inject to presenter viewState using
@InjectViewState
over the presenter-class - Implement view-interface at some activity, fragment or other
- Inject presenter into view through
@InjectPresenter
annotation over required presenter-field in view-class - That's all) Now you can use presenter without caring about his recreation and configuration changes
- Implement required libraries (app/build.gradle):
- Dependency injection applying
-
Multithreading calls managing
- Reactive Network: dynamic internet connection observing
- Advanced dealing with UI by creating Binding adapters