Buttons with Icons in overview

This commit is contained in:
jbr7rr 2023-07-01 17:35:43 +02:00
parent f52726128a
commit af7e38a6db
3 changed files with 44 additions and 9 deletions

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#42A5F5"
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
</vector>

View file

@ -0,0 +1,14 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="#FF4444"
android:pathData="M12,12 L36,36 M36,12 L12,36"
android:strokeWidth="3"
android:strokeLineCap="round"
android:strokeColor="#FF4444"/>
</vector>

View file

@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable <variable
name="viewmodel" name="viewmodel"
type="info.nightscout.pump.medtrum.ui.viewmodel.MedtrumOverviewViewModel" /> type="info.nightscout.pump.medtrum.ui.viewmodel.MedtrumOverviewViewModel" />
@ -295,7 +296,7 @@
android:layout_marginEnd="20dp" android:layout_marginEnd="20dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:background="?android:attr/dividerHorizontal" /> android:background="?android:attr/dividerHorizontal" />
<!-- Active Alarms --> <!-- Active Alarms -->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -606,7 +607,7 @@
android:background="?android:attr/dividerHorizontal" /> android:background="?android:attr/dividerHorizontal" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
@ -619,34 +620,43 @@
android:orientation="horizontal"> android:orientation="horizontal">
<!-- Refresh button --> <!-- Refresh button -->
<Button <info.nightscout.core.ui.elements.SingleClickButton
android:id="@+id/refreshButton" android:id="@+id/refreshButton"
style="@style/ButtonMediumFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_refresh_conn"
android:ellipsize="end"
android:enabled="@{viewmodel.canDoRefresh}" android:enabled="@{viewmodel.canDoRefresh}"
android:maxLines="2"
android:text="@string/refresh_label" android:text="@string/refresh_label"
app:onSafeClick="@{() -> viewmodel.onClickRefresh()}" /> app:onSafeClick="@{() -> viewmodel.onClickRefresh()}" />
<!-- Reset Alarms button --> <!-- Reset Alarms button -->
<Button <info.nightscout.core.ui.elements.SingleClickButton
android:id="@+id/resetAlarmsButton" android:id="@+id/resetAlarmsButton"
style="@style/ButtonMediumFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/reset_alarms_label" android:drawableTop="@drawable/ic_silence_alerts"
android:ellipsize="end"
android:enabled="@{viewmodel.canDoResetAlarms}" android:enabled="@{viewmodel.canDoResetAlarms}"
android:maxLines="2"
android:text="@string/reset_alarms_label"
app:onSafeClick="@{() -> viewmodel.onClickResetAlarms()}" /> app:onSafeClick="@{() -> viewmodel.onClickResetAlarms()}" />
<!-- Change Patch button --> <!-- Change Patch button -->
<Button <info.nightscout.core.ui.elements.SingleClickButton
android:id="@+id/changePatchButton" android:id="@+id/changePatchButton"
style="@style/ButtonMediumFontStyle" style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:drawableTop="@drawable/ic_actions_refill"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/change_patch_label" android:text="@string/change_patch_label"
app:onSafeClick="@{() -> viewmodel.onClickChangePatch()}" /> app:onSafeClick="@{() -> viewmodel.onClickChangePatch()}" />