HealthConnect: Add settings screen resources

This commit is contained in:
Manuel
2026-05-01 18:12:10 +03:00
committed by Dennis Guse
parent 713e454e44
commit dbd3e2fc5c
5 changed files with 429 additions and 0 deletions
@@ -0,0 +1,347 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/top_app_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
app:title="@string/health_connect_screen_title" />
</com.google.android.material.appbar.AppBarLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">
<TextView
style="?attr/textAppearanceHeadline6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/health_connect_section_general" />
<TextView
android:id="@+id/health_connect_availability_notice"
style="?attr/textAppearanceBody2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/health_connect_not_available"
android:visibility="gone" />
<LinearLayout
android:id="@+id/health_connect_export_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_favorite_border_24" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_connect_export_enabled_title" />
<TextView
android:id="@+id/health_connect_export_summary"
style="?attr/textAppearanceBody2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/health_connect_export_enabled_summary" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/health_connect_export_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/health_connect_manage_data_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_storage_24" />
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:text="@string/health_connect_manage_data_title" />
</LinearLayout>
<LinearLayout
android:id="@+id/health_connect_settings_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_settings_24dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_connect_open_settings_title" />
<TextView
style="?attr/textAppearanceBody2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/health_connect_open_settings_summary" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_baseline_info_24" />
<TextView
style="?attr/textAppearanceBody2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:text="@string/health_connect_disable_note" />
</LinearLayout>
<View
style="@style/HorizontalLine"
android:layout_marginTop="8dp"
android:layout_marginBottom="20dp" />
<TextView
style="?attr/textAppearanceHeadline6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/health_connect_section_sync" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_sync_24" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_connect_sync_status_title" />
<TextView
android:id="@+id/health_connect_sync_status_summary"
style="?attr/textAppearanceBody2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/health_connect_sync_status_never" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:minHeight="72dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_sync_24" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_connect_manual_sync_title" />
<TextView
android:id="@+id/health_connect_manual_sync_summary"
style="?attr/textAppearanceBody2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/health_connect_manual_sync_summary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/health_connect_manual_sync_button"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/health_connect_manual_sync_button" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/health_connect_detailed_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="72dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_map_24dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
style="?attr/textAppearanceSubtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/health_connect_detailed_sync_title" />
<TextView
android:id="@+id/health_connect_detailed_summary"
style="?attr/textAppearanceBody2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/health_connect_detailed_sync_summary" />
</LinearLayout>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/health_connect_detailed_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingVertical="8dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@null"
android:src="@drawable/ic_baseline_info_24" />
<TextView
style="?attr/textAppearanceBody2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_weight="1"
android:text="@string/health_connect_sync_note" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="8dp">
<TextView
style="?attr/textAppearanceBody2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/health_connect_initial_sync_dialog_message" />
<RadioGroup
android:id="@+id/radio_group_sync_period"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<RadioButton
android:id="@+id/radio_preset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/health_connect_initial_sync_preset" />
<Spinner
android:id="@+id/spinner_sync_period"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp" />
<RadioButton
android:id="@+id/radio_custom_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/health_connect_initial_sync_custom_date" />
<Button
android:id="@+id/button_select_date"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:text="@string/health_connect_initial_sync_select_date" />
</RadioGroup>
</LinearLayout>