|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xtremelabs.imageutils.ImagePrecacheAssistant
public class ImagePrecacheAssistant
This utility simplifies the process of implementing precaching in adapters for use in widgets such as ListViews and ViewPagers.
Instructions:
Create a new instance of this class from within adapter.
Implement the methods PrecacheInformationProvider#onRowPrecacheRequestsRequired(int)
and ImagePrecacheAssistant.PrecacheInformationProvider.getCount()
.
In the "getView" method of the adapter, call onPositionVisited(int)
, and pass in the current position.
Nested Class Summary | |
---|---|
static interface |
ImagePrecacheAssistant.PrecacheInformationProvider
This interface must be implemented in order for the ImagePrecacheAssistant to function. |
static class |
ImagePrecacheAssistant.PrecacheRequest
|
Constructor Summary | |
---|---|
ImagePrecacheAssistant(AbstractImageLoader imageLoader,
ImagePrecacheAssistant.PrecacheInformationProvider precacheInformationProvider)
|
Method Summary | |
---|---|
void |
onPositionVisited(int position)
This method must be called in the getView method of your adapter. |
void |
setDiskCacheRange(int range)
Adjust the number of positions ahead of those that become cached in memory that will be cached on disk. |
void |
setMemCacheRange(int range)
Adjust the number of positions ahead that become cached in both the disk and memory caches. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImagePrecacheAssistant(AbstractImageLoader imageLoader, ImagePrecacheAssistant.PrecacheInformationProvider precacheInformationProvider)
Method Detail |
---|
public void onPositionVisited(int position)
position
- The current position within the adapter.public void setMemCacheRange(int range)
range
- public void setDiskCacheRange(int range)
range
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |