mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-24 08:37:32 +01:00
Widget: do not show sleep if not recorded
This commit is contained in:
parent
2101b5840a
commit
3fdec8d7d3
@ -141,6 +141,10 @@ public class Widget extends AppWidgetProvider {
|
|||||||
double distanceMeters = dailyTotals[0] * stepLength * 0.01;
|
double distanceMeters = dailyTotals[0] * stepLength * 0.01;
|
||||||
String distanceFormatted = FormatUtils.getFormattedDistanceLabel(distanceMeters);
|
String distanceFormatted = FormatUtils.getFormattedDistanceLabel(distanceMeters);
|
||||||
|
|
||||||
|
if (sleep < 1) {
|
||||||
|
views.setViewVisibility(R.id.todaywidget_sleep_layout, View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
views.setTextViewText(R.id.todaywidget_steps, String.format("%1s", steps));
|
views.setTextViewText(R.id.todaywidget_steps, String.format("%1s", steps));
|
||||||
views.setTextViewText(R.id.todaywidget_sleep, String.format("%1s", getHM(sleep)));
|
views.setTextViewText(R.id.todaywidget_sleep, String.format("%1s", getHM(sleep)));
|
||||||
views.setTextViewText(R.id.todaywidget_distance, distanceFormatted);
|
views.setTextViewText(R.id.todaywidget_distance, distanceFormatted);
|
||||||
|
@ -171,7 +171,8 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:id="@+id/todaywidget_sleep_layout">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/todaywidget_sleep_icon"
|
android:id="@+id/todaywidget_sleep_icon"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user