类 ImageRequest

java.lang.Object
com.android.volley.Request<android.graphics.Bitmap>
com.android.volley.toolbox.ImageRequest
所有已实现的接口:
Comparable<Request<android.graphics.Bitmap>>

public class ImageRequest extends Request<android.graphics.Bitmap>
A canned request for getting an image at a given URL and calling back with a decoded Bitmap.
  • 构造器详细资料

    • 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 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
    • 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 with ScaleType.CENTER_INSIDE.
  • 方法详细资料

    • getPriority

      public Request.Priority getPriority()
      从类复制的说明: Request
      Returns the Request.Priority of this request; Request.Priority.NORMAL by default.
      覆盖:
      getPriority 在类中 Request<android.graphics.Bitmap>
    • parseNetworkResponse

      protected Response<android.graphics.Bitmap> parseNetworkResponse(NetworkResponse response)
      从类复制的说明: Request
      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.
      指定者:
      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)
      从类复制的说明: Request
      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.
      指定者:
      deliverResponse 在类中 Request<android.graphics.Bitmap>
      参数:
      response - The parsed response returned by Request.parseNetworkResponse(NetworkResponse)