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

Gif animation in recyclerview stop playing after scrolling #899

Closed
zahid-ali-shah opened this issue Jan 16, 2016 · 7 comments
Closed

Gif animation in recyclerview stop playing after scrolling #899

zahid-ali-shah opened this issue Jan 16, 2016 · 7 comments

Comments

@zahid-ali-shah
Copy link

Gif animation in recyclerview stop playing after scrolling and if i scroll again two or three times animation automatically starts again. This problem doesn't occur always. I am using glide 3.7.0-SNAPSHOT. I am using glide in code like this:

Glide.with(context)
                .load(MyApp.INSTANCE.getUser().getUserAvatar())
                .fitCenter()
                .centerCrop()
                .thumbnail(0.1f)
                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                .placeholder(R.drawable.ic_profile_picture)
                .into(holder.imageView); 

Am I doing something wrong ?

@TWiStErRob
Copy link
Collaborator

The only thing that pops out is fitCenter/centerCrop, you can't apply both, because it overwrites, but it doesn't make any difference if you remove fitCenter.

How fast do you scroll back and forth? How far do you scroll from the GIF? Can you post a video? Can you please try to make a repro app where it happens most of the time? You could try without placeholder or thumbnail, maybe add dontAnimate. These sometimes offer a not so nice workaround.

You should remember that recycler view recycles the items so when you scroll a GIF out, it'll be actually cleared and overwritten with another image. So your description sounds like: "memory cached GIFs are not started again sometimes".

Actually, since you're using thumbnail, is it possible you're seeing the thumbnail for a long time when "gif stops playing"? You could try to add listeners to both the main load and thumbnail and log what's happening. Alternatively you could add some effect to the thumbail, like color filter or flip it upside down transformation to distinguish it.

@LNeway
Copy link

LNeway commented May 15, 2017

@TWiStErRob

Hello , I have the same when I use recyclerview and glide.

that is my code in onBindView

Glide.with(fragment).load(gifImage).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(imageView);

I will try to load the gifs ( 100+ ) from the internet , after the first part load successfully , I scroll the
recyclerview , then all the gifs which plays normal will stop. after the the second part load successfully , all the gifs will play normal again.

Do you have any suggestion about this issue ? thank you very much!!!

@mlostekk
Copy link

Same issue here. Any suggestions?

@sjudd
Copy link
Collaborator

sjudd commented Oct 11, 2017

What networking library are you using?

@mlostekk
Copy link

I am using retrofit2. What is glide using internally?

@sjudd sjudd closed this as completed in c4db04e Oct 12, 2017
@feng88724
Copy link

Same issue here. Any suggestions?

@GokhanArik
Copy link

I had the same problem today and mine was caused by a 3rd party LayoutManager we were using. After switching to the LinearLayoutManager it started working properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants