I set my recyclerView's layoutManager like this:
recyclerView.layoutManager = LinearLayoutManager(context, HORIZONTAL, true)
The last parameter sets the reverseLayout to true which means it will be loaded from right to left. I need this because I implement a sort of calendar where the last date is current date but you can scroll into the past infinitely.
The problem is that when in my adapter I call notifyItemChanged or notifyDataSetChanged the list scrolls a few pixels to the right. This doesn't happen with reverseLayout=false.
It also only happens while the size of the RecyclerView is MATCH_PARENT, when I set it manually to whatever dp, the problem is gone.
Any ideas what happens and how to cope with it?
Maybe it is too late, but anyway, I'm leaving this here. Using constraint layout with match constraints on recyclerview (0dp with horizontal constraints) solved the problem for me.