mirror of https://github.com/tasks/tasks
More attempts at fixing day/night
parent
12b9059159
commit
c9c2dd6d7a
@ -1,19 +1,43 @@
|
||||
package org.tasks.injection;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import org.tasks.analytics.Tracker;
|
||||
import org.tasks.locale.Locale;
|
||||
import org.tasks.themes.Theme;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public abstract class ThemedInjectingAppCompatActivity extends InjectingAppCompatActivity {
|
||||
public abstract class ThemedInjectingAppCompatActivity extends AppCompatActivity implements InjectingActivity {
|
||||
private ActivityComponent activityComponent;
|
||||
|
||||
@Inject Tracker tracker;
|
||||
@Inject Theme theme;
|
||||
|
||||
public ThemedInjectingAppCompatActivity() {
|
||||
Locale.INSTANCE.applyOverrideConfiguration(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
activityComponent = ((InjectingApplication) getApplication()).getComponent().plus(new ActivityModule(this));
|
||||
inject(activityComponent);
|
||||
setTitle(null);
|
||||
theme.applyTheme(this);
|
||||
theme.applyStatusBarColor(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
tracker.showScreen(getClass().getSimpleName());
|
||||
}
|
||||
|
||||
theme.applyThemeAndStatusBarColor(this, getDelegate());
|
||||
@Override
|
||||
public ActivityComponent getComponent() {
|
||||
return activityComponent;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue