I have a RecyclerView
with horizontal items. These items have fix 150dp height
and 100dp width
.
When the Fragment is loaded, than I set default items to this view.
After that, I make a Room getImages()
call, when the result arrive than I rebuild this RecyclerView.
As you see in the GIF :
- Default images loaded (2 with play button, 3 with pro image)
- Add getImages() result
- The result is inserted before the 1st default item
Play button cards have fix id actually ("-1"
) and pro have another fix ("0"
) and every image item have unique id.
The new item is added before the first item, and the user don't see it. The RecyclerView won't scroll to first item. There is any solution push the first item to right when a new one added to 1st place??
I tried the smoothScrollToPosition
but it won't work after submitList()
and maybe where is any better solution.