Fix PTR extra offset calculation (#10172)

This commit is contained in:
Ivan Iskandar 2023-11-25 20:56:15 +07:00 committed by GitHub
parent 60150423d7
commit 356fc5b524
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,7 +196,7 @@ private class PullToRefreshStateImpl(
val newOffset = (distancePulled + available.y).coerceAtLeast(0f)
val dragConsumed = newOffset - distancePulled
distancePulled = newOffset
verticalOffset = calculateVerticalOffset() + (extraVerticalOffset * progress)
verticalOffset = calculateVerticalOffset() + (extraVerticalOffset * progress.coerceIn(0f, 1f))
dragConsumed
}
return Offset(0f, y)