Closed julianonunes closed 5 years ago
the todo-mvp-kotlin
doesn't use Dagger. If you are interested in the dagger sample, it's over in todo-mvp-dagger
So that's an error with the files in the todo-mvp-kotlin
repo (e.g.: AddEditTaskActivity.kt, as the activities have an import for the Injection
class.
package com.example.android.architecture.blueprints.todoapp.addedittask
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.example.android.architecture.blueprints.todoapp.Injection
import com.example.android.architecture.blueprints.todoapp.R
import com.example.android.architecture.blueprints.todoapp.util.replaceFragmentInActivity
import com.example.android.architecture.blueprints.todoapp.util.setupActionBar
/**
* Displays an add or edit task screen.
*/
class AddEditTaskActivity : AppCompatActivity() {
The injection class is only used here as a service locator. This has nothing to do with Dagger; Dagger is only one way to do dependency injection. The todo-mvp-kotlin
uses another one, a manual one.
Now I see what's happening. I could not find this injection class as it is in a folder called prod
and I was looking only under the main
folder.
@julianonunes You can change the build variant to either mock or prod. So the injection class that is used will depend on your build variant. So if you choose the MockDebug variant for instance, it will use the injection class of that in the mock folder. This makes it easy as sometimes you might want to test using dummy data etc.
I'm trying to understand the code from the todo-mvp-kotlin sample, and found calls using an Injection class. The problem is that I could not find any dependencies to Dagger or other DI library, nor any module configuration.