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,10 +1,17 @@
<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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/unlock" android:id="@+id/unlock"
style="@style/GrayButton" style="@style/GrayButton"
@ -19,97 +26,212 @@
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.card.MaterialCardView
android:id="@+id/log"
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/log_files" />
<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_logsettings" 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:layout_weight="0.5"
android:text="@string/nav_logsettings" android:text="@string/nav_logsettings"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="0"
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/log_send" 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:layout_weight="0.5"
android:text="@string/send_all_logs" android:text="@string/send_all_logs"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="1"
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/log_delete" android:id="@+id/log_delete"
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_delete"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/delete_logs" android:text="@string/delete_logs"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="0"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="1" />
<com.google.android.material.button.MaterialButton </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" android:id="@+id/nav_export"
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_export_settings"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_export" android:text="@string/nav_export"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="0"
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_import" android:id="@+id/nav_import"
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_import_settings"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_import" android:text="@string/nav_import"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="1"
app:layout_columnWeight="1"
app:layout_gravity="fill"
app:layout_row="0" />
<com.google.android.material.button.MaterialButton </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" android:id="@+id/export_csv"
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_excel"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/ue_export_to_csv" android:text="@string/ue_export_to_csv"
android:textColor="?attr/treatmentButton" /> android:textSize="11sp"
app:layout_column="0"
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/nav_resetdb"
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_reset_database"
android:layout_marginTop="3dp" android:paddingStart="0dp"
android:layout_marginEnd="10dp" android:paddingEnd="0dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_resetdb" android:text="@string/nav_resetdb"
android:textColor="?attr/treatmentButton" /> 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>
</FrameLayout> </LinearLayout>
</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>