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

Any best practises for RecyclerView? #35

Closed
MenosGrante opened this issue Aug 16, 2019 · 6 comments
Closed

Any best practises for RecyclerView? #35

MenosGrante opened this issue Aug 16, 2019 · 6 comments
Labels
needs info Further information is requested

Comments

@MenosGrante
Copy link

Is your feature request related to a problem? Please describe.
I would like to know, how can I optimize Coil for proper work with RecyclerView. I am loading the whole device's gallery in it using Coil and it properly loads all images separately, but if I would scroll list there are animations drops. Maybe there is some kind of optimization for such situations?

@MenosGrante MenosGrante added the enhancement New feature or request label Aug 16, 2019
@colinrtwhite
Copy link
Member

colinrtwhite commented Aug 16, 2019

Hi, can you post a GIF/video of the issue you're running into? Coil should be efficient by default when working with RecyclerViews. Requests will be automatically stopped as the Views scroll off screen. Bitmap pooling also helps with recycling memory on pre-O.

@colinrtwhite colinrtwhite added needs info Further information is requested and removed enhancement New feature or request labels Aug 16, 2019
@MenosGrante
Copy link
Author

MenosGrante commented Aug 19, 2019

Here it is. I am loading the whole gallery using MediaStore and MediaStore.Images.Media.EXTERNAL_CONTENT_URI and loading it using imageView.load(uri).

Maybe the good decision to convert it in bitmaps at first and then populate the list. Any ideas?

@colinrtwhite
Copy link
Member

Maybe the good decision to convert it in bitmaps at first and then populate the list

I'm not sure I follow. Can you post a sample project that reproduces the issue? Thanks.

@colinrtwhite
Copy link
Member

It looks like the images in the GIF you posted aren't being cached in the memory cache. Currently, the image cache only supports BitmapDrawables.

@ZacSweers
Copy link
Contributor

Currently, the image cache only supports BitmapDrawables.

Is that a technical limitation or just not implemented?

@colinrtwhite
Copy link
Member

colinrtwhite commented Sep 16, 2019

@ZacSweers Not implemented, though I have a WIP branch which should make it into an upcoming release. It was planned to support all Drawables for the initial Coil release, but I ran out of time. If you'd like I can tag you on the PR when it's ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants