mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
fix: drawScrollbar crash on list with 0 item but only sticky header (#1083)
This commit is contained in:
parent
3f6bd5f010
commit
04db46fe75
1 changed files with 3 additions and 3 deletions
|
@ -119,15 +119,15 @@ private fun Modifier.drawScrollbar(
|
||||||
0f
|
0f
|
||||||
} else {
|
} else {
|
||||||
items
|
items
|
||||||
.fastFirstOrNull { (it.key as? String)?.startsWith(STICKY_HEADER_KEY_PREFIX)?.not() ?: true }!!
|
.fastFirstOrNull { (it.key as? String)?.startsWith(STICKY_HEADER_KEY_PREFIX)?.not() ?: true }
|
||||||
.run {
|
?.run {
|
||||||
val startPadding = if (reverseDirection) {
|
val startPadding = if (reverseDirection) {
|
||||||
layoutInfo.afterContentPadding
|
layoutInfo.afterContentPadding
|
||||||
} else {
|
} else {
|
||||||
layoutInfo.beforeContentPadding
|
layoutInfo.beforeContentPadding
|
||||||
}
|
}
|
||||||
startPadding + ((estimatedItemSize * index - offset) / totalSize * viewportSize)
|
startPadding + ((estimatedItemSize * index - offset) / totalSize * viewportSize)
|
||||||
}
|
} ?: 0f
|
||||||
}
|
}
|
||||||
val drawScrollbar = onDrawScrollbar(
|
val drawScrollbar = onDrawScrollbar(
|
||||||
orientation, reverseDirection, atEnd, showScrollbar,
|
orientation, reverseDirection, atEnd, showScrollbar,
|
||||||
|
|
Loading…
Reference in a new issue