1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-23 13:30:48 +02:00
Gadgetbridge/app/src/main/res/xml/dashboard_preferences.xml
Arjan Schrijver 43fddd0110 Dashboard view (#3478)
This adds a new dashboard-type view to Gadgetbridge. The new dashboard activity displays several widgets with aggregated statistics from multiple devices. New preferences are added to allow configuration of the dashboard and its widgets. A new bottom navigation bar is added to switch between the Dashboard and Devices views.

Some issues that prompted this feature and provided inspiration for the implementation:
- https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/301 (More Intuitive User Interface)
- https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/3074 (Ability to merge historical data from several devices)

Reviewed-on: https://codeberg.org/Freeyourgadget/Gadgetbridge/pulls/3478
Reviewed-by: José Rebelo <joserebelo@noreply.codeberg.org>
Co-authored-by: Arjan Schrijver <a_gadgetbridge@anymore.nl>
Co-committed-by: Arjan Schrijver <a_gadgetbridge@anymore.nl>
2024-04-04 19:28:04 +00:00

115 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:key="pref_key_dashboard_general"
android:title="@string/pref_header_general"
app:iconSpaceReserved="false">
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_as_default_view"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_first_title"
android:summary="@string/pref_dashboard_first_summary"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_cards_enabled"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_cards_title"
android:summary="@string/pref_dashboard_cards_summary"
app:iconSpaceReserved="false" />
<com.mobeta.android.dslv.DragSortListPreference
android:defaultValue="@array/pref_dashboard_widgets_order_values"
android:dialogTitle="@string/menuitem_widgets"
android:entries="@array/pref_dashboard_widgets_order"
android:entryValues="@array/pref_dashboard_widgets_order_values"
android:key="pref_dashboard_widgets_order"
android:persistent="true"
android:summary="@string/pref_dashboard_widgets_order_summary"
android:title="@string/menuitem_widgets"
app:iconSpaceReserved="false" />
</PreferenceCategory>
<PreferenceCategory
android:key="pref_key_dashboard_widgets"
android:title="@string/pref_dashboard_widget_settings"
app:iconSpaceReserved="false">
<PreferenceScreen
android:key="pref_key_dashboard_today"
android:title="@string/pref_dashboard_widget_today_title"
app:iconSpaceReserved="false">
<SwitchPreferenceCompat
android:defaultValue="false"
android:key="dashboard_widget_today_24h"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_widget_today_24h_title"
android:summary="@string/pref_dashboard_widget_today_24h_summary"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_widget_today_2columns"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_widget_double_size_title"
android:summary="@string/pref_dashboard_widget_double_size_summary"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_widget_today_legend"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_widget_show_legend_title"
android:summary="@string/pref_dashboard_widget_show_legend_summary"
app:iconSpaceReserved="false" />
<EditTextPreference
android:defaultValue="1"
android:inputType="number"
android:key="dashboard_widget_today_hr_interval"
android:maxLength="4"
android:summary="@string/pref_dashboard_widget_today_hr_interval_summary"
android:title="@string/pref_dashboard_widget_today_hr_interval_title"
app:iconSpaceReserved="false" />
</PreferenceScreen>
<PreferenceScreen
android:key="pref_key_dashboard_goals"
android:title="@string/pref_dashboard_widget_goals_chart_title"
app:iconSpaceReserved="false">
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_widget_goals_2columns"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_widget_double_size_title"
android:summary="@string/pref_dashboard_widget_double_size_summary"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_widget_goals_legend"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_widget_show_legend_title"
android:summary="@string/pref_dashboard_widget_show_legend_summary"
app:iconSpaceReserved="false" />
</PreferenceScreen>
</PreferenceCategory>
<PreferenceCategory
android:key="pref_key_dashboard_devices"
android:title="@string/pref_dashboard_devices_to_include"
app:iconSpaceReserved="false">
<SwitchPreferenceCompat
android:defaultValue="true"
android:key="dashboard_devices_all"
android:layout="@layout/preference_checkbox"
android:title="@string/pref_dashboard_all_devices_title"
android:summary="@string/pref_dashboard_all_devices_summary"
android:disableDependentsState="true"
app:iconSpaceReserved="false" />
<MultiSelectListPreference
android:dependency="dashboard_devices_all"
android:dialogTitle="@string/pref_dashboard_select_devices_title"
android:entries="@array/empty_array"
android:entryValues="@array/empty_array"
android:key="dashboard_devices_multiselect"
android:title="@string/pref_dashboard_select_devices_title"
android:summary="@string/pref_dashboard_select_devices_summary"
app:iconSpaceReserved="false" />
</PreferenceCategory>
</PreferenceScreen>