mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-11 14:43:13 +02:00
Fix bad indexes in MaterialMenuSheet
This commit is contained in:
parent
b39225cac5
commit
1858d70f97
@ -83,12 +83,13 @@ class MaterialMenuSheet(
|
||||
binding.toolbarTitle.text = title
|
||||
|
||||
if (selectedId != null) {
|
||||
itemAdapter.getAdapterItem(selectedId).isSelected = true
|
||||
val pos = itemAdapter.getAdapterPosition(selectedId.toLong())
|
||||
itemAdapter.getAdapterItem(pos).isSelected = true
|
||||
binding.root.post {
|
||||
binding.root.post {
|
||||
binding.menuSheetRecycler.scrollBy(
|
||||
0,
|
||||
selectedId * 48.dpToPx - binding.menuSheetRecycler.height / 2
|
||||
pos * 48.dpToPx - binding.menuSheetRecycler.height / 2
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user