Public 成员函数 | |
| ImageRequest (String url, Response.Listener< Bitmap > listener, int maxWidth, int maxHeight, Config decodeConfig, Response.ErrorListener errorListener) | |
| Priority | getPriority () |
Protected 成员函数 | |
| Response< Bitmap > | parseNetworkResponse (NetworkResponse response) |
| void | deliverResponse (Bitmap response) |
静态包函数 | |
| static int | findBestSampleSize (int actualWidth, int actualHeight, int desiredWidth, int desiredHeight) |
Private 成员函数 | |
| Response< Bitmap > | doParse (NetworkResponse response) |
静态 Private 成员函数 | |
| static int | getResizedDimension (int maxPrimary, int maxSecondary, int actualPrimary, int actualSecondary) |
Private 属性 | |
| final Response.Listener< Bitmap > | mListener |
| final Config | mDecodeConfig |
| final int | mMaxWidth |
| final int | mMaxHeight |
静态 Private 属性 | |
| static final int | IMAGE_TIMEOUT_MS = 1000 |
| static final int | IMAGE_MAX_RETRIES = 2 |
| static final float | IMAGE_BACKOFF_MULT = 2f |
| static final Object | sDecodeLock = new Object() |
A canned request for getting an image at a given URL and calling back with a decoded Bitmap.
|
inline |
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 |
| decodeConfig | Format to decode the bitmap to |
| errorListener | Error listener, or null to ignore errors |
|
inlineprotected |
|
inlineprivate |
The real guts of parseNetworkResponse. Broken out for readability.
|
inlinestaticpackage |
Returns the largest power-of-two divisor for use in downscaling a bitmap that will not result in the scaling past the desired dimensions.
| actualWidth | Actual width of the bitmap |
| actualHeight | Actual height of the bitmap |
| desiredWidth | Desired width of the bitmap |
| desiredHeight | Desired height of the bitmap |
|
inline |
|
inlinestaticprivate |
Scales one side of a rectangle to fit aspect ratio.
| maxPrimary | Maximum size of the primary dimension (i.e. width for max width), or zero to maintain aspect ratio with secondary dimension |
| maxSecondary | Maximum size of the secondary dimension, or zero to maintain aspect ratio with primary dimension |
| actualPrimary | Actual size of the primary dimension |
| actualSecondary | Actual size of the secondary dimension |
|
inlineprotected |
|
staticprivate |
Default backoff multiplier for image requests
|
staticprivate |
Default number of retries for image requests
|
staticprivate |
Socket timeout in milliseconds for image requests
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
Decoding lock so that we don't decode more than one image at a time (to avoid OOM's)
1.8.8