Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when call notifydatasetchanged() image view refresh #395

Closed
ansuangry opened this issue Sep 7, 2013 · 11 comments
Closed

when call notifydatasetchanged() image view refresh #395

ansuangry opened this issue Sep 7, 2013 · 11 comments
Labels

Comments

@ansuangry
Copy link

when call notifydatasetchange() image view refresh reload all the images in Android Grid View

@NtcWai
Copy link

NtcWai commented Sep 10, 2013

I get the same problem when config DisplayImageOption with .displayer(new FadeInBitmapDisplayer(600)).
after call notifyDataSetChanged(), the screen splashing

@ansuangry
Copy link
Author

waiting for ans :(

@ansuangry
Copy link
Author

👎

@IstiN
Copy link

IstiN commented Sep 13, 2013

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 :)

@NtcWai
Copy link

NtcWai commented Sep 16, 2013

It worked 👯
Thank you, IstiN

@Lingviston
Copy link

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.

@ta4
Copy link

ta4 commented Sep 30, 2013

solve istin doesn't work

@Lingviston
Copy link

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);

@ansuangry
Copy link
Author

no luck no one work for me :(
plz help me people ...............
i m waiting ?

@lizijin
Copy link

lizijin commented Oct 21, 2013

.memoryCacheSize(2 * 1024 * 1024) is too small comment this line .

@nostra13
Copy link
Owner

nostra13 commented Dec 1, 2013

Let's move the discussion into related issue - #376

@nostra13 nostra13 closed this as completed Dec 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants