0

I would like to know if there is any native way to "smooth scroll" a RecyclerView in a predetermined time.

To exemplify my question, I would like that a vertical RecyclerView, with 10000dp height, scroll from the bottom to the top with the same amount of time that it would scroll from its middle (5000dp) to the top.

If interpolators were available to be used, it would be awesome :)


I couldn't find anything similar to .scrollTo(pos: Int, interpolator: Interpolator, duration: Long)

Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61

1 Answers1

0

I think you can find your answer here. Basically you should override LinearSmoothScroller behavior and implement your own logic in calculateSpeedPerPixel method (the name speaks for itself).

Tiko
  • 990
  • 7
  • 18