Introducing nucleus

This commit is contained in:
inorichi
2015-10-16 19:31:18 +02:00
parent 68f1102c40
commit 235ed36fbe
3 changed files with 113 additions and 0 deletions
@@ -17,6 +17,7 @@ import timber.log.Timber;
public class App extends Application {
AppComponent mApplicationComponent;
ComponentReflectionInjector<AppComponent> mComponentInjector;
@Override
public void onCreate() {
@@ -27,6 +28,9 @@ public class App extends Application {
.appModule(new AppModule(this))
.build();
mComponentInjector =
new ComponentReflectionInjector<>(AppComponent.class, mApplicationComponent);
//ACRA.init(this);
}
@@ -38,6 +42,14 @@ public class App extends Application {
return mApplicationComponent;
}
public ComponentReflectionInjector<AppComponent> getComponentReflection() {
return mComponentInjector;
}
public static ComponentReflectionInjector<AppComponent> getComponentReflection(Context context) {
return get(context).getComponentReflection();
}
public static AppComponent getComponent(Context context) {
return get(context).getComponent();
}