|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.ListPreloader<T>
T
- The type of the model being displayed in the list.public class ListPreloader<T>
Loads a few resources ahead in the direction of scrolling in any AbsListView
so that images are in the memory
cache just before the corresponding view in created in the list. Gives the appearance of an infinitely large image
cache, depending on scrolling speed, cpu speed, and cache size.
Must be set using AbsListView.setOnScrollListener(android.widget.AbsListView.OnScrollListener)
, or have its
corresponding methods called from another AbsListView.OnScrollListener
to function.
Nested Class Summary | |
---|---|
static interface |
ListPreloader.PreloadModelProvider<U>
An implementation of PreloadModelProvider should provide all the models that should be preloaded. |
static interface |
ListPreloader.PreloadSizeProvider<T>
An implementation of PreloadSizeProvider should provide the size of the view in the list where the resources will be displayed. |
Field Summary |
---|
Fields inherited from interface android.widget.AbsListView.OnScrollListener |
---|
SCROLL_STATE_FLING, SCROLL_STATE_IDLE, SCROLL_STATE_TOUCH_SCROLL |
Constructor Summary | |
---|---|
ListPreloader(int maxPreload)
Deprecated. Use ListPreloader(com.bumptech.glide.ListPreloader.PreloadModelProvider,
com.bumptech.glide.ListPreloader.PreloadSizeProvider, int) instead. This constructor will be removed in Glide
4.0. |
|
ListPreloader(ListPreloader.PreloadModelProvider<T> preloadModelProvider,
ListPreloader.PreloadSizeProvider<T> preloadDimensionProvider,
int maxPreload)
Constructor for ListPreloader that accepts interfaces for providing the dimensions of
images to preload, the list of models to preload for a given position, and the request to use to load images. |
Method Summary | |
---|---|
protected int[] |
getDimensions(T item)
Deprecated. Use ListPreloader.PreloadSizeProvider instead. This method will be removed
in Glide 4.0. |
protected List<T> |
getItems(int start,
int end)
Deprecated. Use ListPreloader.PreloadModelProvider instead. This method will be
removed in Glide 4.0. |
protected GenericRequestBuilder |
getRequestBuilder(T item)
Deprecated. Use ListPreloader.PreloadModelProvider instead. This method will be
removed in Glide 4.0. |
void |
onScroll(AbsListView absListView,
int firstVisible,
int visibleCount,
int totalCount)
|
void |
onScrollStateChanged(AbsListView absListView,
int scrollState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
@Deprecated public ListPreloader(int maxPreload)
ListPreloader(com.bumptech.glide.ListPreloader.PreloadModelProvider,
com.bumptech.glide.ListPreloader.PreloadSizeProvider, int)
instead. This constructor will be removed in Glide
4.0.
ListPreloader
that requires users to subclass and override
the getItems(int, int)
and getRequestBuilder(Object)
methods.
maxPreload
- Maximum number of items to preload.public ListPreloader(ListPreloader.PreloadModelProvider<T> preloadModelProvider, ListPreloader.PreloadSizeProvider<T> preloadDimensionProvider, int maxPreload)
ListPreloader
that accepts interfaces for providing the dimensions of
images to preload, the list of models to preload for a given position, and the request to use to load images.
preloadModelProvider
- Provides models to load and requests capable of loading them.preloadDimensionProvider
- Provides the dimensions of images to load.maxPreload
- Maximum number of items to preload.Method Detail |
---|
public void onScrollStateChanged(AbsListView absListView, int scrollState)
onScrollStateChanged
in interface AbsListView.OnScrollListener
public void onScroll(AbsListView absListView, int firstVisible, int visibleCount, int totalCount)
onScroll
in interface AbsListView.OnScrollListener
@Deprecated protected int[] getDimensions(T item)
ListPreloader.PreloadSizeProvider
instead. This method will be removed
in Glide 4.0.
Note - The size returned here must precisely match those of the view in the list.
item
- A model
@Deprecated protected List<T> getItems(int start, int end)
ListPreloader.PreloadModelProvider
instead. This method will be
removed in Glide 4.0.
start
and end
.
A list of any size can be returned so there can be multiple models per adapter position.
start
- The smallest adapter position. Will be >= 0 && < adapter.getCount() &&
<= end
end
- The largest adapter position. Will be >= 0 && < adapter.getCount && >=
start
@Deprecated protected GenericRequestBuilder getRequestBuilder(T item)
ListPreloader.PreloadModelProvider
instead. This method will be
removed in Glide 4.0.
GenericRequestBuilder
for a given item. Must exactly match the
request used to load the resource in the list.
The target and context will be provided by the preloader.
item
- The model to load.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |