Android - Remove deceleration of fling in Scroller

232 views Asked by At

This single line which I use in my code makes the fling, but it slows down at the end.

mScroller.fling(getScrollX(), getScrollY(), velocityX, velocityY, 0, right - width, 0, bottom - height);

So how can I remove the deceleration/slowing down of the scroller.

PS: I have tried adding Interpolator to Scroller but still same issue.

2

There are 2 answers

0
Carnal On BEST ANSWER

I ended up using this instead which works fine:

mScroller.startScroll(getScrollX(), getScrollY(), dx, dy, duration);
2
Fredrik Metcalf On

Have you tried using setFriction(0) or perhaps using LinearInterpolator?