|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.herroworld.imagegrabber.ImageWorker
com.herroworld.imagegrabber.ImageResizer
com.herroworld.imagegrabber.ImageGrabber
public class ImageGrabber
A simple subclass of ImageResizer
that fetches and resizes images
fetched from a URL.
Constructor Summary | |
---|---|
ImageGrabber(Context context,
int imageSize)
Initialize providing a single target image size (used for both width and height); |
|
ImageGrabber(Context context,
int imageWidth,
int imageHeight)
Initialize providing a target image width and height for the processing images. |
Method Summary | |
---|---|
java.io.File |
downloadBitmap(Context context,
java.lang.String urlString,
boolean forceFetch)
Download a bitmap from a URL, write it to a disk and return the File pointer. |
boolean |
isModified(long lastModified,
java.net.HttpURLConnection urlConnection)
Checking for a server status code 304 response to determine if the image has been modified since the last time the file was written |
void |
setHttpCacheDir(java.lang.String dirName)
Setter for http cache directory, default is http. |
void |
setHttpCacheSize(int cacheSize)
Setter for http cache size, default is 10MB. |
Methods inherited from class com.herroworld.imagegrabber.ImageResizer |
---|
calculateInSampleSize, decodeSampledBitmapFromFile, decodeSampledBitmapFromResource, setImageSize, setImageSize |
Methods inherited from class com.herroworld.imagegrabber.ImageWorker |
---|
cancelWork, getImageCache, loadImage, setAlwaysFetchFromServer, setExitTasksEarly, setFadeInTime, setImageCache, setImageFadeIn, setLoadingImage |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageGrabber(Context context, int imageWidth, int imageHeight)
context
- imageWidth
- imageHeight
- public ImageGrabber(Context context, int imageSize)
context
- imageSize
- Method Detail |
---|
public void setHttpCacheSize(int cacheSize)
cacheSize
- In bytes.public void setHttpCacheDir(java.lang.String dirName)
dirName
- public java.io.File downloadBitmap(Context context, java.lang.String urlString, boolean forceFetch)
context
- The context to useurlString
- The URL to fetchforceFetch
- Whether or not to force a network response even if the
image is cached
public boolean isModified(long lastModified, java.net.HttpURLConnection urlConnection) throws java.io.IOException
lastModified
- File last modified timeurlConnection
-
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |