mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Fix potential crash where selected index is out of range
This commit is contained in:
parent
8ace4ef557
commit
209cd05e46
@ -186,10 +186,11 @@ class MaterialSpinnerView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
popup.menu.forEach {
|
||||
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||
}
|
||||
popup.menu[selectedPosition].icon = tintedCheck()
|
||||
popup.menu[selectedPosition].title =
|
||||
popup.menu[selectedPosition].title?.tintText(context.getResourceColor(android.R.attr.colorAccent))
|
||||
|
||||
popup.menu.getItem(selectedPosition)?.let { menuItem ->
|
||||
menuItem.icon = tintedCheck()
|
||||
menuItem.title =
|
||||
menuItem.title?.tintText(context.getResourceColor(android.R.attr.colorAccent))
|
||||
}
|
||||
this.popup = popup
|
||||
return popup
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user