java.lang.Object | ||
↳ | com.android.volley.Request<T> | |
↳ | com.android.volley.toolbox.ImageRequest |
A canned request for getting an image at a given URL and calling back with a decoded Bitmap.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float | DEFAULT_IMAGE_BACKOFF_MULT | Default backoff multiplier for image requests | |||||||||
int | DEFAULT_IMAGE_MAX_RETRIES | Default number of retries for image requests | |||||||||
int | DEFAULT_IMAGE_TIMEOUT_MS | Socket timeout in milliseconds for image requests |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageRequest(String url, Listener<Bitmap> listener, int maxWidth, int maxHeight, ImageView.ScaleType scaleType, Bitmap.Config decodeConfig, Response.ErrorListener errorListener)
Creates a new image request, decoding to a maximum specified width and
height.
| |||||||||||
ImageRequest(String url, Listener<Bitmap> listener, int maxWidth, int maxHeight, Bitmap.Config decodeConfig, Response.ErrorListener errorListener)
For API compatibility with the pre-ScaleType variant of the constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Request.Priority |
getPriority()
Returns the
Request.Priority of this request; NORMAL by default. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
deliverResponse(Bitmap response)
Subclasses must implement this to perform delivery of the parsed
response to their listeners.
| ||||||||||
Response<Bitmap> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.android.volley.Request
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Default backoff multiplier for image requests
Default number of retries for image requests
Socket timeout in milliseconds for image requests
Creates a new image request, decoding to a maximum specified width and height. If both width and height are zero, the image will be decoded to its natural size. If one of the two is nonzero, that dimension will be clamped and the other one will be set to preserve the image's aspect ratio. If both width and height are nonzero, the image will be decoded to be fit in the rectangle of dimensions width x height while keeping its aspect ratio.
url | URL of the image |
---|---|
listener | Listener to receive the decoded bitmap |
maxWidth | Maximum width to decode this bitmap to, or zero for none |
maxHeight | Maximum height to decode this bitmap to, or zero for none |
scaleType | The ImageViews ScaleType used to calculate the needed image size. |
decodeConfig | Format to decode the bitmap to |
errorListener | Error listener, or null to ignore errors |
For API compatibility with the pre-ScaleType variant of the constructor. Equivalent to
the normal constructor with ScaleType.CENTER_INSIDE
.
Returns the Request.Priority
of this request; NORMAL
by default.
Subclasses must implement this to perform delivery of the parsed response to their listeners. The given response is guaranteed to be non-null; responses that fail to parse are not delivered.
response | The parsed response returned by
parseNetworkResponse(NetworkResponse)
|
---|
Subclasses must implement this to parse the raw network response and return an appropriate response type. This method will be called from a worker thread. The response will not be delivered if you return null.
response | Response from the network |
---|