From 2b834f96c94df46abcf26770505bd0c94d2beeb3 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 29 Oct 2016 19:00:53 +0200 Subject: [PATCH 1/3] update changelog --- CHANGELOG.md | 2 +- app/src/main/res/xml/changelog_master.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eec8740b..1fec508cd 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/res/xml/changelog_master.xml b/app/src/main/res/xml/changelog_master.xml index b3455775b..7ca5092e4 100644 --- a/app/src/main/res/xml/changelog_master.xml +++ b/app/src/main/res/xml/changelog_master.xml @@ -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 Mi Band 2: Support multiple alarms (3 at the moment) From e50574d23c53d8ebac5647231dd76d7df1bcce37 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Sat, 29 Oct 2016 19:01:39 +0200 Subject: [PATCH 2/3] change string "Open in Pebble Appstore" in "Search in Pebble Appstore" --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3666b6d40..62a5c8b2c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,7 +25,7 @@ Delete Delete and remove from cache Reinstall - Open in Pebble Appstore + Search in Pebble Appstore Activate Deactivate Configure From b9bfb8c93a5d07fb97f72af25ed67bd43f1d888a Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 29 Oct 2016 20:29:35 +0200 Subject: [PATCH 3/3] Use attr resources to enable theme dependent colors for the charts. --- .../charts/AbstractChartFragment.java | 21 ++++++++++++------- app/src/main/res/values/attrs.xml | 7 +++++++ app/src/main/res/values/styles.xml | 8 ++----- 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 app/src/main/res/values/attrs.xml 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 253d03885..e314023d7 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 000000000..1a0a1bd07 --- /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/styles.xml b/app/src/main/res/values/styles.xml index 5d6ea28d8..26eaea46a 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -6,12 +6,10 @@ @color/primarydark_light @color/accent - - + @color/chart_not_worn_light