类 ImageRequest
java.lang.Object
com.android.volley.Request<android.graphics.Bitmap>
com.android.volley.toolbox.ImageRequest
- 所有已实现的接口:
Comparable<Request<android.graphics.Bitmap>>
A canned request for getting an image at a given URL and calling
back with a decoded Bitmap.
-
嵌套类概要
从类继承的嵌套类/接口 com.android.volley.Request
Request.Method, Request.Priority -
构造器概要
构造器构造器说明ImageRequest(String url, Response.Listener<android.graphics.Bitmap> listener, int maxWidth, int maxHeight, android.graphics.Bitmap.Config decodeConfig, Response.ErrorListener errorListener) 已过时。ImageRequest(String url, Response.Listener<android.graphics.Bitmap> listener, int maxWidth, int maxHeight, android.widget.ImageView.ScaleType scaleType, android.graphics.Bitmap.Config decodeConfig, Response.ErrorListener errorListener) Creates a new image request, decoding to a maximum specified width and height. -
方法概要
修饰符和类型方法说明protected voiddeliverResponse(android.graphics.Bitmap response) Subclasses must implement this to perform delivery of the parsed response to their listeners.Returns theRequest.Priorityof this request;Request.Priority.NORMALby default.protected Response<android.graphics.Bitmap>parseNetworkResponse(NetworkResponse response) Subclasses must implement this to parse the raw network response and return an appropriate response type.从类继承的方法 com.android.volley.Request
addMarker, cancel, compareTo, deliverError, getBody, getBodyContentType, getCacheEntry, getCacheKey, getErrorListener, getHeaders, getMethod, getParams, getParamsEncoding, getPostBody, getPostBodyContentType, getPostParams, getPostParamsEncoding, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toString
-
构造器详细资料
-
ImageRequest
public ImageRequest(String url, Response.Listener<android.graphics.Bitmap> listener, int maxWidth, int maxHeight, android.widget.ImageView.ScaleType scaleType, android.graphics.Bitmap.Config decodeConfig, Response.ErrorListener errorListener) 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 imagelistener- Listener to receive the decoded bitmapmaxWidth- Maximum width to decode this bitmap to, or zero for nonemaxHeight- Maximum height to decode this bitmap to, or zero for nonescaleType- The ImageViews ScaleType used to calculate the needed image size.decodeConfig- Format to decode the bitmap toerrorListener- Error listener, or null to ignore errors
-
ImageRequest
@Deprecated public ImageRequest(String url, Response.Listener<android.graphics.Bitmap> listener, int maxWidth, int maxHeight, android.graphics.Bitmap.Config decodeConfig, Response.ErrorListener errorListener) 已过时。For API compatibility with the pre-ScaleType variant of the constructor. Equivalent to the normal constructor withScaleType.CENTER_INSIDE.
-
-
方法详细资料
-
getPriority
从类复制的说明:RequestReturns theRequest.Priorityof this request;Request.Priority.NORMALby default.- 覆盖:
getPriority在类中Request<android.graphics.Bitmap>
-
parseNetworkResponse
从类复制的说明:RequestSubclasses 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.- 指定者:
parseNetworkResponse在类中Request<android.graphics.Bitmap>- 参数:
response- Response from the network- 返回:
- The parsed response, or null in the case of an error
-
deliverResponse
protected void deliverResponse(android.graphics.Bitmap response) 从类复制的说明:RequestSubclasses 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.- 指定者:
deliverResponse在类中Request<android.graphics.Bitmap>- 参数:
response- The parsed response returned byRequest.parseNetworkResponse(NetworkResponse)
-