diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HRVStatusFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HRVStatusFragment.java index d021f193c..757dacdc1 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HRVStatusFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/HRVStatusFragment.java @@ -95,9 +95,9 @@ public class HRVStatusFragment extends AbstractChartFragment 0 ? getString(R.string.hrv_status_unit, today.lastNight5MinHigh) : "-"); mHRVStatusDayAvg.setText(today.dayAvg > 0 ? getString(R.string.hrv_status_unit, today.dayAvg) : "-"); mHRVStatusBaseline.setText(today.baseLineBalancedLower > 0 && today.baseLineBalancedUpper > 0 ? getString(R.string.hrv_status_baseline, today.baseLineBalancedLower, today.baseLineBalancedUpper) : "-"); - switch (today.status.getNum()) { - case 0: + switch (today.status) { + case NONE: mHRVStatusSevenDaysAvgStatus.setText("-"); mHRVStatusSevenDaysAvgStatus.setTextColor(TEXT_COLOR); break; - case 1: + case POOR: mHRVStatusSevenDaysAvgStatus.setText(getString(R.string.hrv_status_poor)); mHRVStatusSevenDaysAvgStatus.setTextColor(getResources().getColor(R.color.hrv_status_poor)); break; - case 2: + case LOW: mHRVStatusSevenDaysAvgStatus.setText(getString(R.string.hrv_status_low)); mHRVStatusSevenDaysAvgStatus.setTextColor(getResources().getColor(R.color.hrv_status_low)); break; - case 3: + case UNBALANCED: mHRVStatusSevenDaysAvgStatus.setText(getString(R.string.hrv_status_unbalanced)); mHRVStatusSevenDaysAvgStatus.setTextColor(getResources().getColor(R.color.hrv_status_unbalanced)); break; - case 4: + case BALANCED: mHRVStatusSevenDaysAvgStatus.setText(getString(R.string.hrv_status_balanced)); mHRVStatusSevenDaysAvgStatus.setTextColor(getResources().getColor(R.color.hrv_status_balanced)); break; @@ -214,7 +214,7 @@ public class HRVStatusFragment extends AbstractChartFragment summarySamples = getSamples(db, device, startTs, endTs); List valueSamples = getHrvValueSamples(db, device, startTs, endTs); - int avgHRV = (int) valueSamples.stream().mapToInt(v -> {return v.getValue();}).average().orElse(0); + int avgHRV = (int) valueSamples.stream().mapToInt(HrvValueSample::getValue).average().orElse(0); if (!summarySamples.isEmpty()) { int finalCounter = counter; Calendar finalDay = (Calendar) day.clone(); @@ -305,11 +305,12 @@ public class HRVStatusFragment extends AbstractChartFragment chart) {} protected static class HRVStatusWeeklyData extends ChartsData { private final List data; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cf994d495..8e65e64a3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1439,20 +1439,20 @@ Editing linked GPX track Today Yesterday - DAY AVG - DAY AVG(MS) - 7 DAY AVG - STATUS + Day average + Daily average (ms) + 7-day average + Status Balanced Unbalanced Low Poor - LAST NIGHT - LST N HIGHEST 5-MIN AVG - 7 DAY AVERAGE + Last night + Last night 5-min max avg + 7-day average %1$d ms %1$d-%2$d ms - BASELINE + Baseline Biking Treadmill Exercise