diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index a16c6ac471..e4f5208471 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -76,7 +76,7 @@ class TempTargetDialog : DialogFragmentWithDate() { val adapterReason = ArrayAdapter(context, R.layout.spinner_centered, reasonList) overview_temptarget_reason.adapter = adapterReason overview_temptarget_reason.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { val defaultDuration: Double val defaultTarget: Double when (reasonList[position]) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/Comparator.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/Comparator.kt index 86fd8dc73e..11b8d1b952 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/Comparator.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/Comparator.kt @@ -74,7 +74,7 @@ class Comparator(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { value = Compare.values()[position] } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorConnect.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorConnect.kt index 3e293fef5a..5d2d47edf9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorConnect.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorConnect.kt @@ -48,7 +48,7 @@ class ComparatorConnect(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { value = Compare.values()[position] } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorExists.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorExists.kt index 2e7e437bd9..cb7eb8a32e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorExists.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/ComparatorExists.kt @@ -48,7 +48,7 @@ class ComparatorExists(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { value = Compare.values()[position] } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDelta.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDelta.kt index a667b51099..e7624a98c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDelta.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDelta.kt @@ -76,7 +76,7 @@ class InputDelta(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { deltaType = DeltaType.values()[position] } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDropdownMenu.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDropdownMenu.kt index 7f894293f9..473d26bb4b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDropdownMenu.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputDropdownMenu.kt @@ -38,7 +38,7 @@ class InputDropdownMenu(injector: HasAndroidInjector) : Element(injector) { ).also { it.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) } spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { setValue(itemList[position].toString()) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputLocationMode.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputLocationMode.kt index 9e3f7280cc..e5e42fa60a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputLocationMode.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputLocationMode.kt @@ -62,7 +62,7 @@ class InputLocationMode(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { value = Mode.values()[position] } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputProfileName.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputProfileName.kt index 57e010eabe..57f2b904b7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputProfileName.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/elements/InputProfileName.kt @@ -36,7 +36,7 @@ class InputProfileName(injector: HasAndroidInjector) : Element(injector) { spinnerParams.setMargins(0, resourceHelper.dpToPx(4), 0, resourceHelper.dpToPx(4)) spinner.layoutParams = spinnerParams spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { value = profileList[position].toString() } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt index 8574bfa05c..6d19c24441 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerConnector.kt @@ -160,7 +160,7 @@ class TriggerConnector(injector: HasAndroidInjector) : Trigger(injector) { params.weight = 1.0f spinner.layoutParams = params spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>?, view: View, position: Int, id: Long) { + override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { setType(Type.values()[position]) } 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 188ce707db..463c7564fa 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 @@ -104,7 +104,7 @@ class EditQuickWizardDialog : DaggerDialogFragment() { overview_editquickwizard_usetemptarget_spinner.setSelection(entry.useTempTarget()) overview_editquickwizard_usecob_spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { - override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) = processCob() + override fun onItemSelected(parent: AdapterView<*>, view: View?, position: Int, id: Long) = processCob() override fun onNothingSelected(parent: AdapterView<*>) {} } processCob()