-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Feature list preloader support multiple target sizes #273
Feature list preloader support multiple target sizes #273
Conversation
Is that |
@TWiStErRob which |
|
@@ -102,16 +100,36 @@ | |||
*/ | |||
@Deprecated | |||
public ListPreloader(int maxPreload) { | |||
this(null, null, maxPreload); | |||
this.preloadModelProvider = new PreloadModelProvider<T>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, this is definitely cleaner, thanks!
… to preloadAdapterPosition(List<T> items, int position, boolean isIncreasing)
…rt-multiple-sizes Feature list preloader support multiple target sizes
To provide different target sizes in the
ListPreloader
, i had toPreloadSizeProvider<T>
togetPreloadSize(T item, int adapterPostion, int itemPosition)
PreloadModelProvide
to request the preload items one by one. This is needed to provide theitemPosition
toPreloadSizeProvider.getPreloadSize()
method.In addition i added some test cases for the new functionality and adapt the old tests to the one by one approach.
I also change the deprecated
ListPreloader(int maxPreload)
constructor, to remove some null checks and make it easier to later remove the deprecated constructor and the methods.regard,
David