New Maintenance fragment with icons

This commit is contained in:
Philoul 2022-05-29 23:12:36 +02:00
parent a8200a8480
commit 1fce1eb487
2 changed files with 215 additions and 91 deletions

View file

@ -1,115 +1,237 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.core.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="2dp" android:paddingTop="2dp"
tools:context=".plugins.general.maintenance.MaintenanceFragment"> tools:context=".plugins.general.maintenance.MaintenanceFragment">
<com.google.android.material.button.MaterialButton
android:id="@+id/unlock"
style="@style/GrayButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/unlock_settings" />
<LinearLayout <LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/nav_logsettings" android:id="@+id/unlock"
style="@style/GrayButton" style="@style/GrayButton"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_gravity="center"
android:layout_marginTop="3dp" android:text="@string/unlock_settings" />
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_logsettings"
android:textColor="?attr/treatmentButton" />
<com.google.android.material.button.MaterialButton <LinearLayout
android:id="@+id/log_send" android:id="@+id/main_layout"
style="@style/GrayButton" android:layout_width="match_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:orientation="vertical">
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/send_all_logs"
android:textColor="?attr/treatmentButton" />
<com.google.android.material.button.MaterialButton <com.google.android.material.card.MaterialCardView
android:id="@+id/log_delete" android:id="@+id/log"
style="@style/GrayButton" style="@style/Widget.MaterialComponents.CardView"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="4dp"
android:layout_marginTop="3dp" android:layout_marginEnd="4dp"
android:layout_marginEnd="10dp" android:layout_marginTop="4dp"
android:layout_marginBottom="3dp" app:cardCornerRadius="4dp"
android:layout_weight="0.5" app:contentPadding="2dp"
android:text="@string/delete_logs" app:cardElevation="2dp"
android:textColor="?attr/treatmentButton" /> app:cardUseCompatPadding="false"
android:layout_gravity="center">
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/nav_export" android:layout_width="match_parent"
style="@style/GrayButton" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:paddingStart="15dp"
android:layout_height="wrap_content" android:paddingEnd="15dp"
android:layout_marginStart="10dp" android:layout_marginBottom="10dp"
android:layout_marginTop="3dp" android:text="@string/log_files" />
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_export"
android:textColor="?attr/treatmentButton" />
<com.google.android.material.button.MaterialButton <androidx.gridlayout.widget.GridLayout
android:id="@+id/nav_import" android:layout_width="match_parent"
style="@style/GrayButton" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:layout_marginTop="10dp"
android:layout_height="wrap_content" android:padding="10dip"
android:layout_marginStart="10dp" app:columnCount="2">
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_import"
android:textColor="?attr/treatmentButton" />
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/export_csv" android:id="@+id/nav_logsettings"
style="@style/GrayButton" style="@style/GrayButton"
android:layout_width="fill_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:drawableTop="@drawable/ic_log_settings"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp" android:text="@string/nav_logsettings"
android:layout_weight="0.5" android:textSize="11sp"
android:text="@string/ue_export_to_csv" app:layout_column="0"
android:textColor="?attr/treatmentButton" /> app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
<com.google.android.material.button.MaterialButton <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/nav_resetdb" android:id="@+id/log_send"
style="@style/GrayButton" style="@style/GrayButton"
android:layout_width="fill_parent" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:drawableTop="@drawable/ic_send_log"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp" android:text="@string/send_all_logs"
android:layout_weight="0.5" android:textSize="11sp"
android:text="@string/nav_resetdb" app:layout_column="1"
android:textColor="?attr/treatmentButton" /> app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/log_delete"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_log_delete"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/delete_logs"
android:textSize="11sp"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="1" />
</androidx.gridlayout.widget.GridLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/nav"
style="@style/Widget.MaterialComponents.CardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginTop="4dp"
app:cardCornerRadius="4dp"
app:contentPadding="2dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="false"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:layout_marginBottom="10dp"
android:text="@string/settings" />
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dip"
app:columnCount="2">
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/nav_export"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_export_settings"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/nav_export"
android:textSize="11sp"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/nav_import"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_import_settings"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/nav_import"
android:textSize="11sp"
app:layout_column="1"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
</androidx.gridlayout.widget.GridLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:id="@+id/misc"
style="@style/Widget.MaterialComponents.CardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:layout_marginTop="4dp"
app:cardCornerRadius="4dp"
app:contentPadding="2dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="false"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:layout_marginBottom="10dp"
android:text="@string/miscellaneous" />
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dip"
app:columnCount="2">
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/export_csv"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_excel"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/ue_export_to_csv"
android:textSize="11sp"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/nav_resetdb"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_reset_database"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/nav_resetdb"
android:textSize="11sp"
app:layout_column="1"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
</androidx.gridlayout.widget.GridLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </androidx.core.widget.NestedScrollView>

View file

@ -830,6 +830,8 @@
<string name="error_adding_treatment_message">A treatment (insulin: %1$.2f, carbs: %2$d, at: %3$s) could not be added to treatments. Please check and manually add a record as appropriate.</string> <string name="error_adding_treatment_message">A treatment (insulin: %1$.2f, carbs: %2$d, at: %3$s) could not be added to treatments. Please check and manually add a record as appropriate.</string>
<string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), delay: %3$d m</string> <string name="generated_ecarbs_note">eCarbs: %1$d g (%2$d h), delay: %3$d m</string>
<string name="openaps_noasdata">No autosens data available</string> <string name="openaps_noasdata">No autosens data available</string>
<string name="log_files">Log files</string>
<string name="miscellaneous">Miscellaneous</string>
<string name="nav_logsettings">Log settings</string> <string name="nav_logsettings">Log settings</string>
<string name="resettodefaults">Reset to defaults</string> <string name="resettodefaults">Reset to defaults</string>
<string name="nsmalfunction">NSClient malfunction. Consider NS and NSClient restart.</string> <string name="nsmalfunction">NSClient malfunction. Consider NS and NSClient restart.</string>