From 5531ddc49a6773554cbeee40cdf9c02a4d4952f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sun, 24 Nov 2024 18:36:20 +0000 Subject: [PATCH] Restore sleep balance on weekly and monthly charts --- .../activities/charts/WeekSleepChartFragment.java | 4 ++++ app/src/main/res/layout/fragment_weeksleep_chart.xml | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/WeekSleepChartFragment.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/WeekSleepChartFragment.java index 274fd785b..097d22a4a 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/WeekSleepChartFragment.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/charts/WeekSleepChartFragment.java @@ -126,6 +126,8 @@ public class WeekSleepChartFragment extends AbstractWeekChartFragment { lightSleepTimeText = rootView.findViewById(R.id.sleep_chart_legend_light_time); sleepDatesText = rootView.findViewById(R.id.sleep_dates); + mBalanceView = rootView.findViewById(R.id.balance); + setupWeekChart(); // refresh immediately instead of use refreshIfVisible(), for perceived performance @@ -186,6 +188,8 @@ public class WeekSleepChartFragment extends AbstractWeekChartFragment { String toFormattedDate = new SimpleDateFormat("E, MMM dd").format(to); String fromFormattedDate = new SimpleDateFormat("E, MMM dd").format(from); sleepDatesText.setText(fromFormattedDate + " - " + toFormattedDate); + + mBalanceView.setText(mcd.getWeekBeforeData().getBalanceMessage()); } @Override diff --git a/app/src/main/res/layout/fragment_weeksleep_chart.xml b/app/src/main/res/layout/fragment_weeksleep_chart.xml index 3e346869f..05724e845 100644 --- a/app/src/main/res/layout/fragment_weeksleep_chart.xml +++ b/app/src/main/res/layout/fragment_weeksleep_chart.xml @@ -19,6 +19,17 @@ android:layout_marginBottom="10dp" /> + + + +