private fun bindExpiryYearDropDown(expiryYears: Pair<Int, Int>) { val adapter = ArrayAdapter<String>( binding.root.context, android.R.layout.simple_spinner_dropdown_item, ) val (startYear, endYear) = expiryYears for (year in startYear until endYear) { adapter.add(year.toString()) } binding.expiryYearDropDown.adapter = adapter }
Setup the expiry year dropdown with the range specified by the provided expiryYears