-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Glide's preloading API to be data based
By data based we mean that we preload based on access to the data, rather than the position of the user in the view. Data based access matches how the Compose paging API works and is much simpler to implement in safe / reasonable way. The primary compromise is that we cannot begin preloading until the data is accessed. If there are multiple disjoint data sets or multiple header rows, we may not preload data while scrolling until we reach the first item in each data set. Users can work around this in each application by manually accessing the prealoding data set, but it's not super convenient. Another option would be to wrap LazyListState and track each insertion via item / items. That would let our preloader track exactly which positions are preloadable and which are not. While the functionality is somewhat better and it's safe, the implementation is much larger and it's more complex for callers to call correctly. We can add it in later if we find that the data based API is painful to use. Yet another option would be to more faithfully implement the ListPreloader interface and rely on users to paper over more gaps, just as we do for non-Compose code. This is significantly more complex for users to implement. We've discussed a few options for this API here: https://chat.google.com/room/AAAAYRnp4-Y/Q61ILNtb8hu
- Loading branch information
Showing
9 changed files
with
483 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
188 changes: 0 additions & 188 deletions
188
...compose/src/androidTest/java/com/bumptech/glide/integration/compose/GlidePreloaderTest.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.