I am using
data.add(0,item);
notifyItemInserted(0);
This works fine as long as the items space is not filled up. After that, animation is not seen.
animation works fine when i do
data.add(1,item);
notifyItemInserted(1);
How to add items in 0 position and show animation all the time. Do I have to use scrollToPosition?
call scrollToPosition(0)
if you wan't it to scroll to position 0 after new item is added. RecyclerView will just keep the current top item in place, which is why you are not seeing the new item. (the new item is being added above the visible area).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With