diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardGoalsWidget.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardGoalsWidget.java index e47a98dc0..eb5a24a4b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardGoalsWidget.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardGoalsWidget.java @@ -34,8 +34,10 @@ import android.widget.TextView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.activities.DashboardFragment; +import nodomain.freeyourgadget.gadgetbridge.util.Prefs; /** * A simple {@link AbstractDashboardWidget} subclass. @@ -84,6 +86,9 @@ public class DashboardGoalsWidget extends AbstractDashboardWidget { SpannableStringBuilder legendBuilder = new SpannableStringBuilder(); legend.setText(legendBuilder.append(l_steps).append(" ").append(l_distance).append("\n").append(l_active_time).append(" ").append(l_sleep)); + Prefs prefs = GBApplication.getPrefs(); + legend.setVisibility(prefs.getBoolean("dashboard_widget_goals_legend", true) ? View.VISIBLE : View.GONE); + fillData(); return goalsView; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardTodayWidget.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardTodayWidget.java index 57bb07e5c..e72a96973 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardTodayWidget.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/dashboard/DashboardTodayWidget.java @@ -113,6 +113,8 @@ public class DashboardTodayWidget extends AbstractDashboardWidget { SpannableStringBuilder legendBuilder = new SpannableStringBuilder(); legend.setText(legendBuilder.append(l_not_worn).append(" ").append(l_worn).append(" ").append(l_activity).append("\n").append(l_light_sleep).append(" ").append(l_deep_sleep)); + legend.setVisibility(prefs.getBoolean("dashboard_widget_today_legend", true) ? View.VISIBLE : View.GONE); + fillData(); return todayView; diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index dc8fd0b33..2b7848ee1 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -109,6 +109,12 @@ android:layout="@layout/preference_checkbox" android:title="Double size" app:iconSpaceReserved="false" /> + +