From 22063f07e327780a38f96fd5194ec9615853a43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Mon, 23 Dec 2024 18:48:21 +0000 Subject: [PATCH] Display sleep HR average for in past 24h mode --- .../activities/charts/DaySleepChartFragment.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/DaySleepChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/DaySleepChartFragment.java index 2d3a7a13b..6709c429e 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/DaySleepChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/DaySleepChartFragment.java @@ -268,9 +268,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment 0 ? View.VISIBLE : View.GONE); dummyTile.setVisibility(intensityTotal > 0 ? View.VISIBLE : View.GONE); - if (!CHARTS_SLEEP_RANGE_24H - && supportsHeartrate(getChartsHost().getDevice()) - && SHOW_CHARTS_AVERAGE) { + if (supportsHeartrate(getChartsHost().getDevice()) && SHOW_CHARTS_AVERAGE) { if (mcd.getHeartRateAxisMax() != 0 || mcd.getHeartRateAxisMin() != 0) { mActivityChart.getAxisRight().setAxisMaximum(mcd.getHeartRateAxisMax() + (mcd.getHeartRateAxisMin() / 2f)); mActivityChart.getAxisRight().setAxisMinimum(mcd.getHeartRateAxisMin() / 2f); @@ -292,7 +290,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment heartRateValues = new ArrayList<>(); HeartRateUtils heartRateUtilsInstance = HeartRateUtils.getInstance(); for (ActivitySample sample : samples) { - if (sample.getKind() == ActivityKind.LIGHT_SLEEP || sample.getKind() == ActivityKind.DEEP_SLEEP) { + if (ActivityKind.isSleep(sample.getKind())) { int heartRate = sample.getHeartRate(); if (heartRateUtilsInstance.isValidHeartRateValue(heartRate)) { heartRateValues.add(heartRate); @@ -490,7 +488,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment