1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-27 19:15:50 +01:00

Restore sleep balance on weekly and monthly charts

This commit is contained in:
José Rebelo 2024-11-24 18:36:20 +00:00
parent b2b79c99cd
commit 5531ddc49a
2 changed files with 15 additions and 0 deletions

View File

@ -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

View File

@ -19,6 +19,17 @@
android:layout_marginBottom="10dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center">
<TextView
android:id="@+id/balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<GridLayout
android:background="@color/gauge_line_color"
android:layout_width="match_parent"