Created
June 17, 2013 09:44
-
-
Save smaspe/5795808 to your computer and use it in GitHub Desktop.
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
public class ExtendedImageLoader extends ImageLoader { | |
/** ... */ | |
/** Creator of Image Requests */ | |
private ImageRequestFactory mImageRequestFactory; | |
/** ... */ | |
/** | |
* Constructs a new ImageLoader. | |
* @param queue The RequestQueue to use for making image requests. | |
* @param imageCache The cache to use as an L1 cache. | |
* @param factory The factory for creating ImageRequests | |
*/ | |
public ExtendedImageLoader(RequestQueue queue, ImageCache imageCache, ImageRequestFactory factory) { | |
super(queue, null); | |
mRequestQueue = queue; | |
mCache = imageCache; | |
mImageRequestFactory = factory; | |
} | |
/** ... */ | |
public ImageContainer get(String requestUrl, ImageListener imageListener, | |
int maxWidth, int maxHeight) { | |
/** ... */ | |
Request<?> newRequest = | |
mImageRequestFactory.getImageRequest(requestUrl, new Listener<Bitmap>() { | |
@Override | |
public void onResponse(Bitmap response) { | |
onGetImageSuccess(cacheKey, response); | |
} | |
}, maxWidth, maxHeight, | |
Config.RGB_565, new ErrorListener() { | |
@Override | |
public void onErrorResponse(VolleyError error) { | |
onGetImageError(cacheKey, error); | |
} | |
}); | |
/** ... */ | |
} | |
/** ... */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment