mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Display sleep HR average for in past 24h mode
This commit is contained in:
parent
b608478ade
commit
22063f07e3
@ -268,9 +268,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment<DaySlee
|
|||||||
movementIntensityTextWrapper.setVisibility(intensityTotal > 0 ? View.VISIBLE : View.GONE);
|
movementIntensityTextWrapper.setVisibility(intensityTotal > 0 ? View.VISIBLE : View.GONE);
|
||||||
dummyTile.setVisibility(intensityTotal > 0 ? View.VISIBLE : View.GONE);
|
dummyTile.setVisibility(intensityTotal > 0 ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
if (!CHARTS_SLEEP_RANGE_24H
|
if (supportsHeartrate(getChartsHost().getDevice()) && SHOW_CHARTS_AVERAGE) {
|
||||||
&& supportsHeartrate(getChartsHost().getDevice())
|
|
||||||
&& SHOW_CHARTS_AVERAGE) {
|
|
||||||
if (mcd.getHeartRateAxisMax() != 0 || mcd.getHeartRateAxisMin() != 0) {
|
if (mcd.getHeartRateAxisMax() != 0 || mcd.getHeartRateAxisMin() != 0) {
|
||||||
mActivityChart.getAxisRight().setAxisMaximum(mcd.getHeartRateAxisMax() + (mcd.getHeartRateAxisMin() / 2f));
|
mActivityChart.getAxisRight().setAxisMaximum(mcd.getHeartRateAxisMax() + (mcd.getHeartRateAxisMin() / 2f));
|
||||||
mActivityChart.getAxisRight().setAxisMinimum(mcd.getHeartRateAxisMin() / 2f);
|
mActivityChart.getAxisRight().setAxisMinimum(mcd.getHeartRateAxisMin() / 2f);
|
||||||
@ -292,7 +290,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment<DaySlee
|
|||||||
List<Integer> heartRateValues = new ArrayList<>();
|
List<Integer> heartRateValues = new ArrayList<>();
|
||||||
HeartRateUtils heartRateUtilsInstance = HeartRateUtils.getInstance();
|
HeartRateUtils heartRateUtilsInstance = HeartRateUtils.getInstance();
|
||||||
for (ActivitySample sample : samples) {
|
for (ActivitySample sample : samples) {
|
||||||
if (sample.getKind() == ActivityKind.LIGHT_SLEEP || sample.getKind() == ActivityKind.DEEP_SLEEP) {
|
if (ActivityKind.isSleep(sample.getKind())) {
|
||||||
int heartRate = sample.getHeartRate();
|
int heartRate = sample.getHeartRate();
|
||||||
if (heartRateUtilsInstance.isValidHeartRateValue(heartRate)) {
|
if (heartRateUtilsInstance.isValidHeartRateValue(heartRate)) {
|
||||||
heartRateValues.add(heartRate);
|
heartRateValues.add(heartRate);
|
||||||
@ -490,7 +488,7 @@ public class DaySleepChartFragment extends AbstractActivityChartFragment<DaySlee
|
|||||||
hrEntry.label = HEARTRATE_LABEL;
|
hrEntry.label = HEARTRATE_LABEL;
|
||||||
hrEntry.formColor = HEARTRATE_COLOR;
|
hrEntry.formColor = HEARTRATE_COLOR;
|
||||||
legendEntries.add(hrEntry);
|
legendEntries.add(hrEntry);
|
||||||
if (!CHARTS_SLEEP_RANGE_24H && SHOW_CHARTS_AVERAGE) {
|
if (SHOW_CHARTS_AVERAGE) {
|
||||||
LegendEntry hrAverageEntry = new LegendEntry();
|
LegendEntry hrAverageEntry = new LegendEntry();
|
||||||
hrAverageEntry.label = HEARTRATE_AVERAGE_LABEL;
|
hrAverageEntry.label = HEARTRATE_AVERAGE_LABEL;
|
||||||
hrAverageEntry.formColor = Color.RED;
|
hrAverageEntry.formColor = Color.RED;
|
||||||
|
Loading…
Reference in New Issue
Block a user