Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

ListView/GridView blinks after notifyDataSetChanged get called.

Open Lingviston opened this issue 13 years ago • 4 comments

Hello, nostra13. I'm using you library inside ListView/GridView. I load data to adapter just once but if I call notifyDataSetChanged then all images start reloading. I'm using memory cache and resetImageView options. I think that "reset" option is a reason, but if I disavle it then I'll see old images of reused views before UIL will display new ones.

Lingviston avatar Sep 30 '13 17:09 Lingviston

i have same issue Lingviston how did u solve it ? please reply me soon .

ansuangry avatar Oct 15 '13 10:10 ansuangry

Like I mentioned here in last comment. https://github.com/nostra13/Android-Universal-Image-Loader/issues/395 If it doesn't help you you can describe here your situation maybe I'll be able to help you find a solution.

Lingviston avatar Oct 15 '13 12:10 Lingviston

I think I know what he means - I just noticed a very similar issue the other day, although not with notifyDataSetChanged() but with this another view that's animated in and then out.

Sometimes when scrolling a gridview (especially visible on a phone where it's displayed on a single column), due to view recycling I noticed that it shows the old (recycled) image for a short period of time until UIL gets to load the right one from memory or disk cache.

A solution to that problem is to use DisplayImageOptions.resetViewBeforeLoading(true) which resolves the original problem, but it my case when I animate this other view in and out (which just pushes and then expands the gridview) it causes this visual flickering for the all images briefly (probably due to re-layouting?) as UIL will reset and reload each image I'm guessing - much easier to notice if you have a larger number of entries on screen (in my case, a gridview on 7 or 10" emulator).

I guess the guys are getting this problem when calling BaseAdapter.notifyDataSetChanged() which will cause the ListView/GridView to refresh it's entries and call BaseAdapter.getView() where I assume they are using ImageLoader.displayImage()...

PS: Even if not using DisplayImageOptions.resetViewBeforeLoading(true) a similar flickering effect can be observed if using DisplayImageOptions.displayer(new FadeInBitmapDisplayer(xxx)), which makes sense in a way for same reasons, when a refresh is triggered.

dandar3 avatar Nov 18 '13 17:11 dandar3

Let's move discussion into related issue - https://github.com/nostra13/Android-Universal-Image-Loader/issues/376

nostra13 avatar Dec 01 '13 11:12 nostra13