Compare commits

...

2 commits

Author SHA1 Message Date
jacques
8c9baa6b8f include custon_switch_btn for choice between Export/Import. The dialog SHOULD change aspect. 2024-06-12 09:34:50 +02:00
jacques
2f6b46a4e6 Create custom radioGroup/radioButton for Export/Import choice.
Add corresponding colors
2024-06-12 09:33:28 +02:00
3 changed files with 36 additions and 23 deletions

View file

@ -13,11 +13,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_height="match_parent"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btn_addFruit"
@ -38,31 +34,14 @@
app:layout_anchor="@+id/constraintLayout"
app:layout_anchorGravity="center">
<RadioGroup
android:id="@+id/radio_select"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<RadioButton
android:id="@+id/backup_btn"
android:layout_width="194dp"
android:layout_height="wrap_content"
android:text="@string/export_prescriptions"/>
<RadioButton
android:id="@+id/restore_btn"
android:layout_width="194dp"
android:layout_height="wrap_content"
android:text="@string/import_prescriptions" />
</RadioGroup>
<include layout="@layout/custom_switch_btn"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btn_backup_location"
style="@style/Widget.MaterialComponents.Button"

View file

@ -0,0 +1,32 @@
<com.google.android.material.button.MaterialButtonToggleGroup android:id="@+id/toggleGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:checkedButton="@id/switch_btn_export"
app:singleSelection="true"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/switch_btn_export"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/export_prescriptions"
android:backgroundTint="@color/selected_backgroundf"
android:textColor="@color/white"
/>
<Button
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/switch_btn_import"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="@string/import_prescriptions"
android:backgroundTint="@color/unselected_backgroud"
android:textColor="@color/white"
/>
</com.google.android.material.button.MaterialButtonToggleGroup>

View file

@ -18,4 +18,6 @@
<color name="led">#31f623</color>
<color name="grey">#777</color>
<color name="unselected_backgroud">#777777</color>
<color name="selected_backgroundf">#4f91ff</color>
</resources>