chore: reuse note layout

This commit is contained in:
Andries Smit 2022-04-06 20:06:59 +02:00
parent e9599fc992
commit 02d2908f9a
2 changed files with 5 additions and 30 deletions

View file

@ -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

View file

@ -211,34 +211,9 @@
</LinearLayout>
<LinearLayout
<include
android:id="@+id/notes_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:labelFor="@+id/notes"
android:padding="10dp"
android:text="@string/notes_label"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="bold" />
<EditText
android:id="@+id/notes"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:autofillHints="@string/notes_label"
android:gravity="start"
android:inputType="text|textCapSentences"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
layout="@layout/notes" />
<LinearLayout
android:id="@+id/checkbox_row"