docs/_docs/image-requests.md
If you need an ImageRequest that consists only of a URI, you can use the helper method ImageRequest.fromURI. Loading multiple-images is a common case of this.
If you need to tell the image pipeline anything more than a simple URI, you need to use ImageRequestBuilder:
Uri uri;
ImageDecodeOptions decodeOptions = ImageDecodeOptions.newBuilder()
.setBackgroundColor(Color.GREEN)
.build();
ImageRequest request = ImageRequestBuilder
.newBuilderWithSource(uri)
.setImageDecodeOptions(decodeOptions)
.setAutoRotateEnabled(true)
.setLocalThumbnailPreviewsEnabled(true)
.setLowestPermittedRequestLevel(RequestLevel.FULL_FETCH)
.setProgressiveRenderingEnabled(false)
.setResizeOptions(new ResizeOptions(width, height))
.build();
uri - the only mandatory field. See Supported URIsautoRotateEnabled - whether to enable auto-rotation.progressiveEnabled - whether to enable progressive loading.postprocessor - component to postprocess the decoded image.resizeOptions - desired width and height. Use with caution. See Resizing.The image pipeline follows a definite sequence in where it looks for the image.
The setLowestPermittedRequestLevel field lets you control how far down this list the pipeline will go. Possible values are:
BITMAP_MEMORY_CACHEENCODED_MEMORY_CACHEDISK_CACHEFULL_FETCHThis is useful in situations where you need an instant, or at least relatively fast, image or none at all.