also use theme in settings

This commit is contained in:
Andreas Shimokawa 2016-04-14 15:34:53 +02:00
parent 4bcebca744
commit 367aced03d
1 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,9 @@ import android.view.ViewGroup;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
/** /**
* A settings activity with support for preferences directly displaying their value. * A settings activity with support for preferences directly displaying their value.
* If you combine such preferences with a custom OnPreferenceChangeListener, you have * If you combine such preferences with a custom OnPreferenceChangeListener, you have
@ -86,6 +89,11 @@ public abstract class AbstractSettingsActivity extends PreferenceActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
if (GBApplication.isDarkThemeEnabled()) {
setTheme(R.style.GadgetbridgeThemeDark);
} else {
setTheme(R.style.GadgetbridgeTheme);
}
getDelegate().installViewFactory(); getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState); getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);