Rewrote Theme
This commit is contained in:
@@ -7,6 +7,7 @@ import org.acra.ACRA;
|
||||
import org.acra.annotation.ReportsCrashes;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper;
|
||||
import eu.kanade.tachiyomi.injection.ComponentReflectionInjector;
|
||||
import eu.kanade.tachiyomi.injection.component.AppComponent;
|
||||
import eu.kanade.tachiyomi.injection.component.DaggerAppComponent;
|
||||
@@ -24,6 +25,8 @@ public class App extends Application {
|
||||
AppComponent applicationComponent;
|
||||
ComponentReflectionInjector<AppComponent> componentInjector;
|
||||
|
||||
private int theme = 0;
|
||||
|
||||
public static App get(Context context) {
|
||||
return (App) context.getApplicationContext();
|
||||
}
|
||||
@@ -38,10 +41,15 @@ public class App extends Application {
|
||||
componentInjector =
|
||||
new ComponentReflectionInjector<>(AppComponent.class, applicationComponent);
|
||||
|
||||
setupTheme();
|
||||
setupEventBus();
|
||||
setupAcra();
|
||||
}
|
||||
|
||||
private void setupTheme() {
|
||||
theme = PreferencesHelper.getTheme(this);
|
||||
}
|
||||
|
||||
protected DaggerAppComponent.Builder prepareAppComponent() {
|
||||
return DaggerAppComponent.builder()
|
||||
.appModule(new AppModule(this));
|
||||
@@ -65,4 +73,12 @@ public class App extends Application {
|
||||
public ComponentReflectionInjector<AppComponent> getComponentReflection() {
|
||||
return componentInjector;
|
||||
}
|
||||
|
||||
public int getAppTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
public void setAppTheme(int theme) {
|
||||
this.theme = theme;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user