2

I am working on an android application in which I am showing some data using recyclerview. First time the data is getting shown perfectly. Now the changes should be reflect in list as any value of the item view get changed. I have used notifyDataSetChanged() to notify adapter about changes. The items view are blinking when they get changed, so user get to know about this effect, how to remove this blinking effect. I've tried using notifyItemRangeChanged() but getting the same blinking effect with this one as well. Please let me know if anyone know about this issue.

Thanks a lot in advanced.

Prithniraj Nicyone
  • 5,021
  • 13
  • 52
  • 78
  • 2
    Possible duplicate of [RecyclerView blinking after notifyDatasetChanged()](https://stackoverflow.com/questions/29331075/recyclerview-blinking-after-notifydatasetchanged) – MSpeed Jul 07 '17 at 10:49
  • I don't think this is possible as if some think was changed in the UI that will update the view which will be reflected as blink, what you can do is use animation so change the content of the view (find of lazy loading) to refresh the data. – Asheesh Jul 07 '17 at 10:50

1 Answers1

1

Use the below code, this will disable the animation effect, hope this helps

ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {    
  ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);    
}
WhiteSpidy.
  • 1,107
  • 1
  • 6
  • 28