fix nullable params

This commit is contained in:
Milos Kozak 2020-07-09 14:26:19 +02:00
parent 9401fd0d80
commit 112032ab0e
10 changed files with 10 additions and 10 deletions

View file

@ -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]) {

View file

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

View file

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

View file

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

View file

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

View file

@ -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())
}

View file

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

View file

@ -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()
}

View file

@ -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])
}

View file

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