Skip to content

Commit

Permalink
Adjust Overscroll effect params to match iOS animations (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
ASalavei authored Jan 30, 2024
1 parent 6d17329 commit d3b2f1c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class CupertinoOverscrollEffect(
val velocity = initialVelocity.toFloat()
val overscroll = overscrollOffset.toFloat()

return if ((velocity < 0f && overscroll > 0f) || (velocity > 0f && overscroll < 0f)) {
return if ((velocity <= 0f && overscroll > 0f) || (velocity >= 0f && overscroll < 0f)) {
playSpringAnimation(
unconsumedDelta = 0f,
velocity,
Expand All @@ -342,14 +342,13 @@ class CupertinoOverscrollEffect(
val spec = when (reason) {
CupertinoSpringAnimationReason.FLING_FROM_OVERSCROLL -> {
spring(
dampingRatio = Spring.DampingRatioLowBouncy,
stiffness = 400f,
stiffness = 300f,
visibilityThreshold = visibilityThreshold
)
}
CupertinoSpringAnimationReason.POSSIBLE_SPRING_IN_THE_END -> {
spring(
stiffness = 200f,
stiffness = 120f,
visibilityThreshold = visibilityThreshold
)
}
Expand Down

0 comments on commit d3b2f1c

Please sign in to comment.