androidscrolleronfling

Android - Remove deceleration of fling in Scroller


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.


Solution

  • I ended up using this instead which works fine:

    mScroller.startScroll(getScrollX(), getScrollY(), dx, dy, duration);