make sure the proper item is selected at coloring spinner
This commit is contained in:
parent
7d7cfa18d4
commit
0776b7c874
1 changed files with 2 additions and 0 deletions
|
@ -23,8 +23,10 @@ class MyAppCompatSpinner : AppCompatSpinner {
|
|||
for (i in 0..cnt - 1)
|
||||
items[i] = adapter.getItem(i)
|
||||
|
||||
val position = selectedItemPosition
|
||||
val padding = resources.getDimension(R.dimen.activity_margin).toInt()
|
||||
adapter = MyArrayAdapter(context, android.R.layout.simple_spinner_item, items, textColor, backgroundColor, padding)
|
||||
setSelection(position)
|
||||
|
||||
val superListener = onItemSelectedListener
|
||||
onItemSelectedListener = object : OnItemSelectedListener {
|
||||
|
|
Loading…
Reference in a new issue