mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-08 19:57:25 +01:00
35 lines
868 B
Java
35 lines
868 B
Java
|
package eu.kanade.mangafeed;
|
||
|
|
||
|
import android.app.Application;
|
||
|
import android.content.Context;
|
||
|
|
||
|
import timber.log.Timber;
|
||
|
|
||
|
public class App extends Application {
|
||
|
|
||
|
AppComponent mApplicationComponent;
|
||
|
|
||
|
@Override
|
||
|
public void onCreate() {
|
||
|
super.onCreate();
|
||
|
if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree());
|
||
|
|
||
|
mApplicationComponent = DaggerAppComponent.builder()
|
||
|
.appModule(new AppModule(this))
|
||
|
.build();
|
||
|
}
|
||
|
|
||
|
public static App get(Context context) {
|
||
|
return (App) context.getApplicationContext();
|
||
|
}
|
||
|
|
||
|
public AppComponent getComponent() {
|
||
|
return mApplicationComponent;
|
||
|
}
|
||
|
|
||
|
// Needed to replace the component with a test specific one
|
||
|
public void setComponent(AppComponent applicationComponent) {
|
||
|
mApplicationComponent = applicationComponent;
|
||
|
}
|
||
|
}
|