6

I have a RecyclerView with 50+ items. Each item contains an image (and text) and fills up most of the screen. I call recyclerView.smoothScrollToPosition(0), but the animation takes more than 3 seconds.

If I call recyclerView.scrollToPosition(10) and then recyclerView.smoothScrollToPosition(0) the RecyclerView scrolls all the way from the bottom to the top (ignoring the request to "jump" to position 10).

Is there any way I can wait for the "jump" before calling smoothScrollToPosition?

Mitkins
  • 4,031
  • 3
  • 40
  • 77
  • See this answer http://stackoverflow.com/questions/31235183/recyclerview-how-to-smooth-scroll-to-top-of-item-on-a-certain-position?answertab=active#tab-top – Gorio Feb 24 '16 at 13:23

1 Answers1

-1

mAdapter.notifyItemInserted(0);

recyclerView.smoothScrollToPosition(0);

Amit_android
  • 498
  • 2
  • 5
  • 20