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

Created on 31 May 2017  Â·  16Comments  Â·  Source: bumptech/glide

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)

Most helpful comment

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.

All 16 comments

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.

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

@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();
//            }
//        });
    }

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.

+1

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

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

+1

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

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

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

+1

Issue is happening because glide is unable to calculate height and width of
view.if you pass height and width then issue doesn't happen

On Fri, Jul 21, 2017 at 1:37 PM, Vladislav Nikolaev <
[email protected]> wrote:

+1

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/bumptech/glide/issues/1981#issuecomment-316934394,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APPrbJot3CPYB1pKUiixisl_IRvWALKeks5sQFwkgaJpZM4NrZHq
.

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.

@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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ncit picture Ncit  Â·  3Comments

MrFuFuFu picture MrFuFuFu  Â·  3Comments

kooeasy picture kooeasy  Â·  3Comments

Anton111111 picture Anton111111  Â·  3Comments

Morteza-Rastgoo picture Morteza-Rastgoo  Â·  3Comments