java.lang.Object | |
↳ | com.neomades.content.image.ImageLoader |
Helper that handles loading and caching images from remote URLs.
The simple way to use this class is to call
setImageUrl(String, ImageLoader)
.
This class can only be used by ImageUrlLabel
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageLoader(ImageCache cache)
Creates an image loader with a specific cache or no cache (see
NoImageCache ). |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageContainer |
get(String requestUrl, ImageListener imageListener)
Returns an ImageContainer for the requested URL.
| ||||||||||
boolean |
isCached(String requestUrl, int maxWidth, int maxHeight)
Checks if the item is available in the cache.
| ||||||||||
void |
setBatchedResponseDelay(int newBatchedResponseDelayMs)
Sets the amount of time to wait after the first response arrives before
delivering all responses.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageQuery |
createImageQuery(String requestUrl, int maxWidth, int maxHeight)
May be overridden to specify custom Image requests.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates an image loader with a specific cache or no cache (see
NoImageCache
).
Returns an ImageContainer for the requested URL.
The ImageContainer will contain either the specified default bitmap or the
loaded bitmap. If the default was returned, the ImageLoader
will be
invoked when the request is fulfilled.
requestUrl | The URL of the image to be loaded. |
---|---|
imageListener | The listener to call when the remote image is loaded |
Checks if the item is available in the cache.
requestUrl | The url of the remote image |
---|---|
maxWidth | The maximum width of the returned image. |
maxHeight | The maximum height of the returned image. |
Sets the amount of time to wait after the first response arrives before delivering all responses. Batching can be disabled entirely by passing in 0.
newBatchedResponseDelayMs | The time in milliseconds to wait. |
---|
May be overridden to specify custom Image requests.
By default, Image queries are configured with HTTP GET Method, without authentication process.
requestUrl | the URL of the image. |
---|---|
maxWidth | the image max size width |
maxHeight | the image max size height |