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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="2dp"
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
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.google.android.material.button.MaterialButton
android:id="@+id/nav_logsettings"
android:id="@+id/unlock"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_logsettings"
android:textColor="?attr/treatmentButton" />
android:layout_gravity="center"
android:text="@string/unlock_settings" />
<com.google.android.material.button.MaterialButton
android:id="@+id/log_send"
style="@style/GrayButton"
android:layout_width="fill_parent"
<LinearLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
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" />
android:orientation="vertical">
<com.google.android.material.button.MaterialButton
android:id="@+id/log_delete"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/delete_logs"
android:textColor="?attr/treatmentButton" />
<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">
<com.google.android.material.button.MaterialButton
android:id="@+id/nav_export"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_export"
android:textColor="?attr/treatmentButton" />
<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" />
<com.google.android.material.button.MaterialButton
android:id="@+id/nav_import"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
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" />
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="10dip"
app:columnCount="2">
<com.google.android.material.button.MaterialButton
android:id="@+id/export_csv"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/ue_export_to_csv"
android:textColor="?attr/treatmentButton" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/nav_logsettings"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_log_settings"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/nav_logsettings"
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
android:id="@+id/nav_resetdb"
style="@style/GrayButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="3dp"
android:layout_weight="0.5"
android:text="@string/nav_resetdb"
android:textColor="?attr/treatmentButton" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/log_send"
style="@style/GrayButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_send_log"
android:paddingStart="0dp"
android:paddingEnd="0dp"
android:text="@string/send_all_logs"
android:textSize="11sp"
app:layout_column="1"
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>
</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="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="log_files">Log files</string>
<string name="miscellaneous">Miscellaneous</string>
<string name="nav_logsettings">Log settings</string>
<string name="resettodefaults">Reset to defaults</string>
<string name="nsmalfunction">NSClient malfunction. Consider NS and NSClient restart.</string>