diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eec8740..1fec508c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ * Mi Band 2: Initial support for heart rate readings (Debug activity only) * Mi Band 2: Support disabled alarms * Attempt to fix spurious device discovery problems -* Update MPAndroidChart to release 3.0 +* Correctly recognize Toffeed, Slimsocial and MaterialFBook as facebook notification sources ####Version 0.13.6 * Mi Band 2: Support for multiple alarms (3 at the moment) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java index 253d0388..e314023d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/AbstractChartFragment.java @@ -8,7 +8,9 @@ import android.os.AsyncTask; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.FragmentActivity; +import android.support.v4.content.ContextCompat; import android.support.v4.content.LocalBroadcastManager; +import android.util.TypedValue; import android.view.View; import com.github.mikephil.charting.charts.BarChart; @@ -155,15 +157,20 @@ public abstract class AbstractChartFragment extends AbstractGBFragment { } protected void init() { + TypedValue runningColor = new TypedValue(); BACKGROUND_COLOR = GBApplication.getBackgroundColor(getContext()); LEGEND_TEXT_COLOR = DESCRIPTION_COLOR = GBApplication.getTextColor(getContext()); - CHART_TEXT_COLOR = getResources().getColor(R.color.secondarytext); - HEARTRATE_COLOR = getResources().getColor(R.color.chart_heartrate); - HEARTRATE_FILL_COLOR = getResources().getColor(R.color.chart_heartrate_fill); - AK_ACTIVITY_COLOR = getResources().getColor(R.color.chart_activity_light); - AK_DEEP_SLEEP_COLOR = getResources().getColor(R.color.chart_light_sleep_light); - AK_LIGHT_SLEEP_COLOR = getResources().getColor(R.color.chart_deep_sleep_light); - AK_NOT_WORN_COLOR = getResources().getColor(R.color.chart_not_worn_light); + CHART_TEXT_COLOR = ContextCompat.getColor(getContext(), R.color.secondarytext); + HEARTRATE_COLOR = ContextCompat.getColor(getContext(), R.color.chart_heartrate); + HEARTRATE_FILL_COLOR = ContextCompat.getColor(getContext(), R.color.chart_heartrate_fill); + getContext().getTheme().resolveAttribute(R.attr.chart_activity, runningColor, true); + AK_ACTIVITY_COLOR = runningColor.data; + getContext().getTheme().resolveAttribute(R.attr.chart_light_sleep, runningColor, true); + AK_DEEP_SLEEP_COLOR = runningColor.data; + getContext().getTheme().resolveAttribute(R.attr.chart_deep_sleep, runningColor, true); + AK_LIGHT_SLEEP_COLOR = runningColor.data; + getContext().getTheme().resolveAttribute(R.attr.chart_not_worn, runningColor, true); + AK_NOT_WORN_COLOR = runningColor.data; HEARTRATE_LABEL = getContext().getString(R.string.charts_legend_heartrate); diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 00000000..1a0a1bd0 --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 93b079da..2f3a8ecc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,7 +32,7 @@ Delete Delete and remove from cache Reinstall - Open in Pebble Appstore + Search in Pebble Appstore Activate Deactivate Configure diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index a51b5fdf..f44e70aa 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,12 +8,10 @@ @color/tertiarytext_light @color/accent - - + @color/chart_not_worn_light