From 356fc5b524f2da6957ad9bb198d15082dda8b14f Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sat, 25 Nov 2023 20:56:15 +0700 Subject: [PATCH] Fix PTR extra offset calculation (#10172) --- .../presentation/core/components/material/PullRefresh.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt index c68dd300f7..dd854c3ac9 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/PullRefresh.kt @@ -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)