From 46086f04082a1a26a719d987e5c2e5f0ac581c05 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Thu, 14 Apr 2016 17:04:49 +0200 Subject: [PATCH] allow dark theme in charts activity. The charts however are still the same --- .../activities/AbstractGBFragmentActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractGBFragmentActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractGBFragmentActivity.java index b76e50c3..dcb87d89 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractGBFragmentActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AbstractGBFragmentActivity.java @@ -5,6 +5,9 @@ import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; +import nodomain.freeyourgadget.gadgetbridge.R; + /** * A base activity that supports paging through fragments by swiping. * Subclasses will have to add a ViewPager to their layout and add something @@ -31,6 +34,12 @@ public abstract class AbstractGBFragmentActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { + if (GBApplication.isDarkThemeEnabled()) { + setTheme(R.style.GadgetbridgeThemeDark); + } else { + setTheme(R.style.GadgetbridgeTheme); + } + super.onCreate(savedInstanceState); // Create the adapter that will return a fragment for each of the three