From 02d2908f9abf1634374efc981d3048bc761596a3 Mon Sep 17 00:00:00 2001 From: Andries Smit Date: Wed, 6 Apr 2022 20:06:59 +0200 Subject: [PATCH 1/2] chore: reuse note layout --- .../androidaps/dialogs/WizardDialog.kt | 6 ++-- app/src/main/res/layout/dialog_wizard.xml | 29 ++----------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index e5ff65ffda..13fc6cc0b8 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -130,7 +130,7 @@ class WizardDialog : DaggerDialogFragment() { val useSuperBolus = sp.getBoolean(R.string.key_usesuperbolus, false) binding.sbCheckbox.visibility = useSuperBolus.toVisibility() binding.superBolusRow.visibility = useSuperBolus.toVisibility() - binding.notesLayout.visibility = sp.getBoolean(R.string.key_show_notes_entry_dialogs, false).toVisibility() + binding.notesLayout.root.visibility = sp.getBoolean(R.string.key_show_notes_entry_dialogs, false).toVisibility() val maxCarbs = constraintChecker.getMaxCarbsAllowed().value() val maxCorrection = constraintChecker.getMaxBolusAllowed().value() @@ -327,7 +327,7 @@ class WizardDialog : DaggerDialogFragment() { binding.carbsInput.value = carbsPassedIntoWizard } if (notesPassedIntoWizard.isNotBlank()) { - binding.notes.setText(notesPassedIntoWizard) + binding.notesLayout.notes.setText(notesPassedIntoWizard) } val profile = profileFunction.getProfile() val profileStore = activePlugin.activeProfileSource.profile @@ -427,7 +427,7 @@ class WizardDialog : DaggerDialogFragment() { binding.ttCheckbox.isChecked, binding.bgTrendCheckbox.isChecked, binding.alarm.isChecked, - binding.notes.text.toString(), + binding.notesLayout.notes.text.toString(), carbTime, usePercentage = usePercentage, totalPercentage = percentageCorrection diff --git a/app/src/main/res/layout/dialog_wizard.xml b/app/src/main/res/layout/dialog_wizard.xml index 91b2bd2a4d..69f9ae3459 100644 --- a/app/src/main/res/layout/dialog_wizard.xml +++ b/app/src/main/res/layout/dialog_wizard.xml @@ -211,34 +211,9 @@ - - - - - - - + layout="@layout/notes" /> Date: Wed, 6 Apr 2022 20:07:11 +0200 Subject: [PATCH 2/2] chore: remove redundant style --- .../main/res/layout/activity_preferences.xml | 1 - .../res/layout/activity_profilehelper.xml | 10 ++-- app/src/main/res/layout/food_fragment.xml | 3 -- core/src/main/res/layout/notes.xml | 47 +++++++++---------- 4 files changed, 25 insertions(+), 36 deletions(-) diff --git a/app/src/main/res/layout/activity_preferences.xml b/app/src/main/res/layout/activity_preferences.xml index d4a7c61fc7..2ff946628a 100644 --- a/app/src/main/res/layout/activity_preferences.xml +++ b/app/src/main/res/layout/activity_preferences.xml @@ -9,7 +9,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/filter" - android:textColorHint="?attr/colorOnPrimary" app:endIconMode="clear_text"> + android:hint="@string/profiletype"> + android:hint="@string/selected_profile"> + android:hint="@string/careportal_profileswitch"> diff --git a/core/src/main/res/layout/notes.xml b/core/src/main/res/layout/notes.xml index 9ee27909a4..96adb89ff0 100644 --- a/core/src/main/res/layout/notes.xml +++ b/core/src/main/res/layout/notes.xml @@ -1,35 +1,32 @@ - - + android:orientation="horizontal"> - + android:hint="@string/notes_label" + app:endIconMode="clear_text"> - + + +