I am trying to update a progressBar which is the part of one of the RecyclerView items. I know I can do it in two ways,
Method 1: By refreshing the item row by calling notifyItemChanged(position)
Method 2: By accessing the view using the method findViewByPosition() on LayoutMananger object.
But unluckily none of them are working in my case.
If I use the first one, the whole item will get repainted, the background color of the recyclerview is gray and the item is white, so the user can notice the whole item refresh.
If I try the second one, I will end up with problems while scrolling.
I want to update progress just like WhatsApp does. Thanks in advance
If I use the first one, the whole item will get repainted, the background color of the recyclerview is gray and the item is white, so the user can notice the whole item refresh.
I ran into this issue as well. To fix it you need to turn off the default item change animations. Once you turn off the item change animations your recyclerView item will update without any flashing/jumping, allowing you to use notifyItemChanged(int)
without any problems.
Turn off the default item change animations like so:
((SimpleItemAnimator) myRecyclerView.getItemAnimator()).setSupportsChangeAnimations(false);
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