when call notifydatasetchanged() image view refresh
when call notifydatasetchange() image view refresh reload all the images in Android Grid View
I get the same problem when config DisplayImageOption with .displayer(new FadeInBitmapDisplayer(600)). after call notifyDataSetChanged(), the screen splashing
waiting for ans :(
:-1:
You can use custom displayer:
new FadeInBitmapDisplayer(300) {
@Override
public Bitmap display(Bitmap bitmap, ImageView imageView, LoadedFrom loadedFrom) {
if (loadedFrom != LoadedFrom.MEMORY_CACHE) {
return super.display(bitmap, imageView, loadedFrom);
} else {
imageView.setImageBitmap(bitmap);
return bitmap;
}
}
}
Problem that people don't read documentation and samples before using it :)
It worked :dancers: Thank you, IstiN
This doesn't work for me. I'm using this options
BitmapDisplayer displayer = new FadeInBitmapDisplayer(500) {
@Override
public Bitmap display(Bitmap bitmap, ImageView imageView,
LoadedFrom loadedFrom) {
if (loadedFrom != LoadedFrom.MEMORY_CACHE) {
return super.display(bitmap, imageView, loadedFrom);
} else {
imageView.setImageBitmap(bitmap);
return bitmap;
}
}
};
DisplayImageOptions options = new DisplayImageOptions.Builder()
.cacheInMemory(true).resetViewBeforeLoading(true)
.showImageForEmptyUri(R.drawable.thumbnail_no_image)
.showImageOnFail(R.drawable.thumbnail_no_image)
.displayer(displayer).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
context).defaultDisplayImageOptions(options)
.memoryCacheSize(2 * 1024 * 1024).build();
sLoader.init(config);
I need to implement selection in gridview so after each item selected I call notifyDataSetChanged and all of the images start reloading. This leads to screen blinking everytime I select an item. It looks like UIL doesn't check if it's loading the same data to the ImageVIew that it already has.
solve istin doesn't work
Ok, I found the only way to avoid this. I added these lines to my adapter:
String thumbTag = (String) thumbnail.getTag();
if (thumbTag == null || !thumbTag.equals(item.path))
ImageManager.displayImage("file:/" + item.path, thumbnail);
thumbnail.setTag(item.path);
no luck no one work for me :( plz help me people ............... i m waiting ?
.memoryCacheSize(2 * 1024 * 1024) is too small comment this line .
Let's move the discussion into related issue - https://github.com/nostra13/Android-Universal-Image-Loader/issues/376