fix to always by default check alarm tickbox in bolus calc wizard when carb time is >0

This commit is contained in:
mushroom-dev 2022-10-01 11:03:10 +02:00
parent 687b1c558b
commit d0d17216d2

View file

@ -92,11 +92,13 @@ class WizardDialog : DaggerDialogFragment() {
} }
private val timeTextWatcher = object : TextWatcher { private val timeTextWatcher = object : TextWatcher {
override fun afterTextChanged(s: Editable) {} override fun afterTextChanged(s: Editable) {
binding.alarm.isChecked = binding.carbTimeInput.value > 0
}
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
calculateInsulin() calculateInsulin()
binding.alarm.isChecked = binding.carbTimeInput.value > 0
} }
} }