RecyclerView - move to a position, then smoothly scroll up

I have a RecyclerView with over 50 items. Each element contains an image (and text) and fills 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 up (ignoring the request to jump to position 10).

Is there any way to wait for a "jump" before calling smoothScrollToPosition ?

+6
source share
1 answer

mAdapter.notifyItemInserted (0);

recyclerView.smoothScrollToPosition (0);

0
source

Source: https://habr.com/ru/post/988763/


All Articles