mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-27 00:15:30 +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 {
|
popup.menu.forEach {
|
||||||
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
it.icon = ContextCompat.getDrawable(context, R.drawable.ic_blank_24dp)
|
||||||
}
|
}
|
||||||
popup.menu[selectedPosition].icon = tintedCheck()
|
popup.menu.getItem(selectedPosition)?.let { menuItem ->
|
||||||
popup.menu[selectedPosition].title =
|
menuItem.icon = tintedCheck()
|
||||||
popup.menu[selectedPosition].title?.tintText(context.getResourceColor(android.R.attr.colorAccent))
|
menuItem.title =
|
||||||
|
menuItem.title?.tintText(context.getResourceColor(android.R.attr.colorAccent))
|
||||||
|
}
|
||||||
this.popup = popup
|
this.popup = popup
|
||||||
return popup
|
return popup
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user