mirror of https://github.com/tasks/tasks
Use dagger for database injection
parent
46739eaee2
commit
d6ca32fdd5
@ -0,0 +1,16 @@
|
|||||||
|
package org.tasks;
|
||||||
|
|
||||||
|
import dagger.ObjectGraph;
|
||||||
|
|
||||||
|
public class Injector {
|
||||||
|
|
||||||
|
ObjectGraph objectGraph;
|
||||||
|
|
||||||
|
public Injector() {
|
||||||
|
objectGraph = ObjectGraph.create(new TasksModule());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void inject(Object caller) {
|
||||||
|
objectGraph.inject(caller);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package org.tasks;
|
||||||
|
|
||||||
|
import com.todoroo.astrid.service.AstridDependencyInjector;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(
|
||||||
|
injects = {
|
||||||
|
AstridDependencyInjector.class
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public class TasksModule {
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue