list: update fastscrollrecyclerview credits

This commit is contained in:
Alexander Capehart 2025-01-04 17:53:18 -07:00
parent 9fe508a906
commit 4679785b78
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -76,6 +76,7 @@ import org.oxycblt.auxio.util.systemBarInsetsCompat
* - Added drag listener * - Added drag listener
* - Added documentation * - Added documentation
* - Completely new design * - Completely new design
* - New scroll position backend
* *
* @author Hai Zhang, Alexander Capehart (OxygenCobalt) * @author Hai Zhang, Alexander Capehart (OxygenCobalt)
* *
@ -338,6 +339,7 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
private fun updateThumbState() { private fun updateThumbState() {
// Then calculate the thumb position, which is just: // Then calculate the thumb position, which is just:
// [proportion of scroll position to scroll range] * [total thumb range] // [proportion of scroll position to scroll range] * [total thumb range]
// This is somewhat adapted from the androidx RecyclerView FastScroller implementation.
val offsetY = computeVerticalScrollOffset() val offsetY = computeVerticalScrollOffset()
if (computeVerticalScrollRange() < height || childCount == 0) { if (computeVerticalScrollRange() < height || childCount == 0) {
fastScrollingPossible = false fastScrollingPossible = false