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

Add a preloader for RecyclerView #240

Closed
sjudd opened this issue Nov 7, 2014 · 8 comments
Closed

Add a preloader for RecyclerView #240

sjudd opened this issue Nov 7, 2014 · 8 comments
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Nov 7, 2014

No description provided.

@sjudd sjudd added this to the 3.5 milestone Nov 7, 2014
@mttmllns
Copy link

mttmllns commented Dec 3, 2014

+1 this would be cool.

@sjudd sjudd modified the milestones: 4.0, 3.5 Jan 21, 2015
@charrondev
Copy link

Is it possible to hack around and preload images in a recycler view with this right now?

@vipinhelloindia
Copy link

+1

@sjudd
Copy link
Collaborator Author

sjudd commented Jan 22, 2015

Absolutely, you just need to call the existing preloader's onScroll method will all of the required values other than the AbsListView. If you're using LinearLayoutManager or GridLayoutManager, you can use this gist: https://gist.github.com/sjudd/0776594543c4b6c30d38

@saket
Copy link

saket commented Jan 22, 2015

This would be wonderful. I'm currently manually calling Glide on each item inside the adapter, but this looks cleaner.

@sjudd
Copy link
Collaborator Author

sjudd commented Jan 22, 2015

@Saketme You'd still need to call Glide on each item in the adapter. The preloader only loads items into memory, not into views. The preloader is a performance improvement that prevents users from seeing images loading while they scroll (assuming the images can be loaded at least as fast as the user is scrolling).

Without the preloader, since you only request images when the view is rendered, the image doesn't start loading until the user can see the view, and so the user will always see a loading indicator.

@saket
Copy link

saket commented Jan 23, 2015

@sjudd That's exactly what I'm doing. Sorry if I wasn't clear enough in my previous post, but I'm currently calling Glide only to preload them into memory using downloadOnly() :D

@TWiStErRob
Copy link
Collaborator

This should be fixed in https://github.com/bumptech/glide/tree/master/integration/recyclerview

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

6 participants