bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.56k stars 6.12k forks source link

Support arbitrary LayoutManagers in RecyclerView integration package #493

Open eicm opened 9 years ago

eicm commented 9 years ago

I was taking a look on RecyclerView integrations and ListPreloader implementation. If I haven't missed anything simply changing RecyclerToListViewScrollListener.java class to get the correct firstVisible, visibleCount and itemCount should be enough to create infinite scrolling for any other type of LayoutManager. Would you please correct me if I'm wrong.

sjudd commented 9 years ago

Assuming I'm understanding you, you're correct. We could definitely add an interface allowing you to pull that data out and provide implementation(s) for the default layout managers.

eicm commented 9 years ago

Right. I was a little bit skeptical that maybe there is a point I am missing, since only LinearLaoutManager was supported in the api.

TWiStErRob commented 9 years ago

It may be possible now to include those in the core library with http://b.android.com/149268 if I understand correctly what you're talking about.

eicm commented 9 years ago

What I'm asking is to have a more general interface to implement pre-loading for any extension of LayoutMangers in RecyclerViews

sjudd commented 9 years ago

@eicm A pull request to implement that functionality would certainly be welcome :)

eicm commented 9 years ago

@sjudd I can't do it this month, if it wasn't implemented in by next month I will gladly do a pull for it :)

TWiStErRob commented 9 years ago

What I meant is the recyclerview integration module (I didn't know it existed :) could be built-in to main library module with a provided dependency on support-recyclerview with a generic interface and multiple implementations.

TWiStErRob commented 8 years ago

@eicm would you have a chance now to do a PR?

sjudd commented 6 years ago

This is pretty easy to do in v4, in fact the existing RecyclerView preloader is just a thin wrapper itself: https://github.com/bumptech/glide/blob/062e9ba0af80437efad8dade830737eee6c2d3c5/integration/recyclerview/src/main/java/com/bumptech/glide/integration/recyclerview/RecyclerViewPreloader.java#L30

Kato129 commented 1 year ago

Delete file