-
public interface GlidePreloadingData<DataT extends Object>Wraps a set of data, triggers image preloads based on the positions provided to get and exposes the data and the preload RequestBuilder.
-
-
Method Summary
Modifier and Type Method Description abstract Pair<DataT, RequestBuilder<Drawable>>get(Integer index)Returns the DataT at a given index in the data and a RequestBuilder that will trigger a request that exactly matches the preload request for this index. abstract IntegergetSize()The total number of items in the data set. -
-
Method Detail
-
get
@Composable() abstract Pair<DataT, RequestBuilder<Drawable>> get(Integer index)
Returns the DataT at a given index in the data and a RequestBuilder that will trigger a request that exactly matches the preload request for this index.
The returned RequestBuilder should always be used to display the item at the given index. Otherwise the preload request triggered by this call is likely useless work. The RequestBuilder can either be used as the primary request, or more likely, passed as the RequestBuilder.thumbnail to a higher resolution request.
This method has side affects! Calling it will trigger preloads based on the given index. Preloading assumes sequential access in a manner that matches what the user will see. If you need to look up data at indices for other reasons, use the underlying data source directly so that you do not confuse the preloader. Only use this method when obtaining data to display to the user.
-
-
-
-