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

Glide 4.0.0-RC0: Images are not loaded when fast scrolling through RecyclerView (worked on 3.7) #1981

Closed
rafakob opened this issue May 31, 2017 · 16 comments
Milestone

Comments

@rafakob
Copy link

rafakob commented May 31, 2017

Glide Version:
Glide 4.0.0-RC0

Integration libraries:
tested with okhttp3-integration:4.0.0-RC0 and without it - same behavior

Issue details:
When fast scrolling through a RecyclerView, images are not loaded. Take a look at this short video. The same list works without any issues on Glide 3.7. How to fix this?

I've attached listener - no errors returned.

https://www.dropbox.com/s/rpfpltgyi32ntmr/2017_05_31_11_28_30.mp4?dl=0

Usage in onBindViewHolder:

GlideApp.with(vh.photo.context)
        .load(model.photoUrl)
        .into(vh.photo)
@rafakob rafakob changed the title Glide 4.0.0-RC0: RecyclerView - images are not loaded when fast scrolling through RecyclerView Glide 4.0.0-RC0: Images are not loaded when fast scrolling through RecyclerView May 31, 2017
@rafakob rafakob changed the title Glide 4.0.0-RC0: Images are not loaded when fast scrolling through RecyclerView Glide 4.0.0-RC0: Images are not loaded when fast scrolling through RecyclerView (worked on 3.7) May 31, 2017
@christopherperry
Copy link

I had the same issue when I upgraded. Check logcat, there's probably errors. I had to change the way things were configured to get it to work.

@TWiStErRob
Copy link
Collaborator

@christopherperry can you be more specific, there shouldn't be a difference except the default pixel format being changed as far as I know.

@christopherperry
Copy link

@TWiStErRob For sure. I had to comment out this bit of code in our AppGlideModule, which worked for the previous version.

@Override
    public void applyOptions(Context context, GlideBuilder builder) {
        // disabling Glide internal cache since we'll be using OkHttp's cache
        // TODO: If you uncomment this images no longer load, are we sure we really want to do this anyways?
//        builder.setDiskCache(new DiskCache.Factory() {
//            @Override
//            public DiskCache build() {
//                // this is a no-op cache: https://github.com/bumptech/glide/wiki/Configuration#disk-cache
//                return new DiskCacheAdapter();
//            }
//        });
    }

@smelfungus
Copy link

smelfungus commented Jun 3, 2017

I'm facing the same issue, log is not reporting any errors.
For instance first image in recycler can be loaded as
Finished loading BitmapDrawable from REMOTE
But if we're going quickly to the end of huge list and returning back - it's not even trying to get the image from MEMORY_CACHE/DATA_DISK_CACHE, it stays blank.
No special configurations are used btw.

@AlexTip
Copy link

AlexTip commented Jun 7, 2017

+1

@TWiStErRob
Copy link
Collaborator

@DummyCo @AlexTip please share Glide load lines and GlideModule configurations.

@yangshiliang
Copy link

+1
exactly the same issue with @rafakob, also used in onBindViewHolder, with no customised configurations, and with the same Glide version and integration library:

Glide.with(context)
         .load(mData.get(position))
         .into(viewHolder.mImageView);

@praveenmoto
Copy link

+1

@smelfungus
Copy link

@TWiStErRob can you please investigate that? Should we create a sample?

@TWiStErRob
Copy link
Collaborator

That would probably help... it seems to affect a lot of people. Maybe something is clogging up the threads.

@ozv101
Copy link

ozv101 commented Jul 13, 2017

Same issue. Seeing it on RC1. Listener callback methods are never fired. Worked on 3.7.

Glide.with(context)
                .asBitmap()
                .transition(withCrossFade())
                .load(new MyUrlLoader(url))
                .apply(new RequestOptions()
                        .diskCacheStrategy(DiskCacheStrategy.RESOURCE))
                .listener(new RequestListener<Bitmap>() {
                    @Override
                    public boolean onLoadFailed(@Nullable GlideException e, Object o, Target<Bitmap> target, boolean b) {
                        Log.e("onLoadFailed", e.getMessage());
                        return false;
                    }

                    @Override
                    public boolean onResourceReady(Bitmap bitmap, Object o, Target<Bitmap> target, DataSource dataSource, boolean b) {
                        return false;
                    }
                })
                .into(new BitmapImageViewTarget(view) {
                    @Override
                    protected void setResource(Bitmap resource) {
                        super.setResource(resource);
                    }
                });

@TWiStErRob looks like this has been an issue for over a month. I really like the other improvements with 4.0 but I can't ship with this bug :(

@VladislavNikolaev
Copy link

+1

@praveenmoto
Copy link

praveenmoto commented Jul 21, 2017 via email

@sjudd
Copy link
Collaborator

sjudd commented Jul 21, 2017

If someone who can reproduce this can attach a sample app the issue is probably fixable.

Unfortunately +1s and load lines aren't especially helpful at this point.

@rafakob
Copy link
Author

rafakob commented Jul 28, 2017

@sjudd Here's the example project. Please don't judge me for the images links, I haven't found any open API which offers high res pictures ;)

https://github.com/rafakob/GlideRecyclerSample

@sjudd sjudd closed this as completed in b476c2a Aug 1, 2017
@sjudd
Copy link
Collaborator

sjudd commented Aug 1, 2017

Thanks for the sample project! I was able to reproduce and I think my change will fix the issue, or at least the one demonstrated in the sample app.

@sjudd sjudd added this to the 4.0 milestone Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants