From e7d58a8f84f8629ee4977ea50328ca3385641958 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 2 Feb 2021 20:25:15 +0100 Subject: [PATCH] EditQuickWizardDialog -> jetpack #2 --- .../overview/dialogs/EditQuickWizardDialog.kt | 14 ++++++-------- .../res/layout/overview_editquickwizard_dialog.xml | 4 +++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt index d2bf09df4f..237afba172 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt @@ -21,8 +21,6 @@ import info.nightscout.androidaps.utils.extensions.setEnableForChildren import info.nightscout.androidaps.utils.extensions.setSelection import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry -import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_editquickwizard_dialog.* import org.json.JSONException import javax.inject.Inject @@ -59,7 +57,7 @@ class EditQuickWizardDialog : DaggerDialogFragment(), View.OnClickListener { position = bundle.getInt("position", -1) } val entry = if (position == -1) quickWizard.newEmptyItem() else quickWizard[position] - ok.setOnClickListener { + binding.okcancel.ok.setOnClickListener { try { entry.storage.put("buttonText", binding.buttonEdit.text.toString()) entry.storage.put("carbs", SafeParse.stringToInt(binding.carbsEdit.text.toString())) @@ -80,12 +78,12 @@ class EditQuickWizardDialog : DaggerDialogFragment(), View.OnClickListener { rxBus.send(EventQuickWizardChange()) dismiss() } - cancel.setOnClickListener { dismiss() } + binding.okcancel.cancel.setOnClickListener { dismiss() } // create an OnTimeSetListener val fromTimeSetListener = TimePickerDialog.OnTimeSetListener { _, hour, minute -> fromSeconds = (T.hours(hour.toLong()).secs() + T.mins(minute.toLong()).secs()).toInt() - from.text = dateUtil.timeString(DateUtil.toDate(fromSeconds)) + binding.from.text = dateUtil.timeString(DateUtil.toDate(fromSeconds)) } binding.from.setOnClickListener { @@ -98,7 +96,7 @@ class EditQuickWizardDialog : DaggerDialogFragment(), View.OnClickListener { } } fromSeconds = entry.validFrom() - from.text = dateUtil.timeString(DateUtil.toDate(fromSeconds)) + binding.from.text = dateUtil.timeString(DateUtil.toDate(fromSeconds)) val toTimeSetListener = TimePickerDialog.OnTimeSetListener { _, hour, minute -> toSeconds = (T.hours(hour.toLong()).secs() + T.mins(minute.toLong()).secs()).toInt() @@ -128,8 +126,8 @@ class EditQuickWizardDialog : DaggerDialogFragment(), View.OnClickListener { binding.useSuperBolus.setSelection(entry.useSuperBolus()) binding.useTempTarget.setSelection(entry.useTempTarget()) - use_cob_yes.setOnClickListener(this) - use_cob_no.setOnClickListener(this) + binding.useCobYes.setOnClickListener(this) + binding.useCobNo.setOnClickListener(this) processCob() } diff --git a/app/src/main/res/layout/overview_editquickwizard_dialog.xml b/app/src/main/res/layout/overview_editquickwizard_dialog.xml index 5dd381371a..89348ac41c 100644 --- a/app/src/main/res/layout/overview_editquickwizard_dialog.xml +++ b/app/src/main/res/layout/overview_editquickwizard_dialog.xml @@ -302,7 +302,9 @@ - +