Kyant
06/12/2026, 1:13 AMAnimatable to represent the overscroll offset with spring animation. The intended onFling flow is:
overscroll settling → performFling(scroll) → overscroll again
Ideally, the velocity should stay continuous across these phases.
The issue happens when the overscroll is settling back, for example when the previous frame has offset.value > 0, but the current frame crosses zero and enters the normal scroll phase. At that point, the offset should be clamped to 0, but I’m not sure what velocity should be passed into performFling.
If I pass the unclamped velocity from the frame that already crossed zero, there is a noticeable jump. My understanding is that we may need to compute the spring velocity exactly at the moment when the offset reaches 0.
Questions:
1. Does that guarantee velocity continuity from the overscroll phase into the scroll phase? Also, does performFling happen in the same frame after the overscroll reaches zero?
2. If there is remaining velocity after performFling and we need to start a new spring animation, it seems like there will be a one-frame delay, which also causes a visible jump.
What is the recommended way to preserve velocity continuity across the entire fling: overscroll, normal scroll, and the next overscroll?Kyant
06/12/2026, 1:15 AM