chore: convert if to kotlin let

This commit is contained in:
Andries Smit 2022-02-01 19:41:51 +01:00
parent 6d9a6eb29f
commit 55927df935

View file

@ -250,22 +250,10 @@ class WizardDialog : DaggerDialogFragment() {
} }
private fun setA11yLabels() { private fun setA11yLabels() {
val bgInputTextId = binding.bgInput.editText?.id binding.bgInput.editText?.id?.let { binding.bgInputLabel.labelFor = it }
if (bgInputTextId != null) { binding.carbsInput.editText?.id?.let { binding.carbsInputLabel.labelFor = it }
binding.bgInputLabel.labelFor = bgInputTextId binding.correctionInput.editText?.id?.let { binding.correctionInputLabel.labelFor = it }
} binding.carbTimeInput.editText?.id?.let { binding.carbTimeInputLabel.labelFor = it }
val carbsTextId = binding.carbsInput.editText?.id
if (carbsTextId != null) {
binding.carbsInputLabel.labelFor = carbsTextId
}
val corrTextId = binding.correctionInput.editText?.id
if (corrTextId != null) {
binding.correctionInputLabel.labelFor = corrTextId
}
val carbTimeTextId = binding.carbTimeInput.editText?.id
if (carbTimeTextId != null) {
binding.carbTimeInputLabel.labelFor = carbTimeTextId
}
} }
override fun onDestroyView() { override fun onDestroyView() {