Skip to content
Noirter de Villefort edited this page Jan 30, 2023 · 3 revisions

Welcome to the Dagger_MVP_Android_Pattern wiki!

Project that use Dagger DI and MVP pattern for Android.

attractive picture :Р

Explanation

package mvp:

  • BaseContract interface - basic interface for other Contracts. Here you write your basic methods for Views and Presenters.
  • BasePresenter class - need to be parent for other Presenters. Has basic logic, that you dont need to write in every Presenter, such as attachView(), init() or destroy().

package di:

  • AppComponent interface - used to tell Dagger about an object (Activity) that requires a dependency(Presenter in our case) to be injected. For that, you expose a function(inject()) that takes as a parameter the object that requests injection(MainActivity in our case).
  • Application class - here we create and store instance of interface, that generates the graph and annotated with @Component, in variable for call inject() in activities.
  • MainModule class - here we define dependencies that would be Injected.