java.lang.Object | |
↳ | com.facebook.imagepipeline.request.ImageRequestBuilder |
Builder class for ImageRequest
s.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | ImageRequestBuilder.BuilderException | An exception class for builder methods. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImageRequest |
build()
Builds the Request.
| ||||||||||
ImageRequestBuilder |
disableDiskCache()
Disables disk cache for this request, regardless where the image will come from.
| ||||||||||
ImageRequestBuilder |
disableMemoryCache()
Disables memory cache for this request.
| ||||||||||
static ImageRequestBuilder |
fromRequest(ImageRequest imageRequest)
Creates a new request builder instance with the same parameters as the imageRequest passed in.
| ||||||||||
BytesRange |
getBytesRange()
Gets the range of bytes if set, null otherwise.
| ||||||||||
ImageRequest.CacheChoice |
getCacheChoice()
Gets the cache choice (profile image or default).
| ||||||||||
int | getDelayMs() | ||||||||||
ImageDecodeOptions | getImageDecodeOptions() | ||||||||||
ImageRequest.RequestLevel |
getLowestPermittedRequestLevel()
Gets the lowest permitted request level.
| ||||||||||
Postprocessor |
getPostprocessor()
Gets postprocessor if set, null otherwise.
| ||||||||||
RequestListener | getRequestListener() | ||||||||||
Priority |
getRequestPriority()
Returns the request priority.
| ||||||||||
ResizeOptions |
getResizeOptions()
Gets the resize options if set, null otherwise.
| ||||||||||
Boolean | getResizingAllowedOverride() | ||||||||||
RotationOptions |
getRotationOptions()
Gets the rotation options if set, null otherwise.
| ||||||||||
Uri |
getSourceUri()
Gets the source Uri.
| ||||||||||
boolean |
isDiskCacheEnabled()
Returns whether the use of the disk cache is enabled, which is partly dependent on the URI.
| ||||||||||
boolean |
isLocalThumbnailPreviewsEnabled()
Returns whether the use of local thumbnails for previews is enabled.
| ||||||||||
boolean |
isMemoryCacheEnabled()
Returns whether the use of the memory cache is enabled.
| ||||||||||
boolean |
isProgressiveRenderingEnabled()
Returns whether progressive loading is enabled.
| ||||||||||
static ImageRequestBuilder |
newBuilderWithResourceId(int resId)
Creates a new request builder instance for a local resource image.
| ||||||||||
static ImageRequestBuilder |
newBuilderWithSource(Uri uri)
Creates a new request builder instance.
| ||||||||||
ImageRequestBuilder |
setAutoRotateEnabled(boolean enabled)
This method is deprecated.
Use #setRotationOptions(RotationOptions)
| ||||||||||
ImageRequestBuilder |
setBytesRange(BytesRange bytesRange)
Set the range of bytes to request from the network (in the case of an HTTP request).
| ||||||||||
ImageRequestBuilder |
setCacheChoice(ImageRequest.CacheChoice cacheChoice)
Sets the cache option.
| ||||||||||
ImageRequestBuilder |
setDelayMs(int delayMs)
Add an artificial delay for this image, in milliseconds.
| ||||||||||
ImageRequestBuilder | setImageDecodeOptions(ImageDecodeOptions imageDecodeOptions) | ||||||||||
ImageRequestBuilder |
setLocalThumbnailPreviewsEnabled(boolean enabled)
Enables or disables the use of local thumbnails as previews.
| ||||||||||
ImageRequestBuilder |
setLowestPermittedRequestLevel(ImageRequest.RequestLevel requestLevel)
Sets the lowest level that is permitted to request the image from.
| ||||||||||
ImageRequestBuilder |
setPostprocessor(Postprocessor postprocessor)
Sets the postprocessor.
| ||||||||||
ImageRequestBuilder |
setProgressiveRenderingEnabled(boolean enabled)
Enables or disables progressive rendering.
| ||||||||||
ImageRequestBuilder |
setRequestListener(RequestListener requestListener)
Sets a request listener to use for just this image request
| ||||||||||
ImageRequestBuilder |
setRequestPriority(Priority requestPriority)
Set priority for the request.
| ||||||||||
ImageRequestBuilder |
setResizeOptions(ResizeOptions resizeOptions)
Sets resize options in case resize should be performed.
| ||||||||||
ImageRequestBuilder | setResizingAllowedOverride(Boolean resizingAllowedOverride) | ||||||||||
ImageRequestBuilder |
setRotationOptions(RotationOptions rotationOptions)
Sets rotation options for the image, whether to rotate by a multiple of 90 degrees, use the
EXIF metadata (relevant to JPEGs only) or to not rotate.
| ||||||||||
ImageRequestBuilder | setShouldDecodePrefetches(Boolean shouldDecodePrefetches) | ||||||||||
ImageRequestBuilder |
setSource(Uri uri)
Sets the source uri (both network and local uris are supported).
| ||||||||||
Boolean | shouldDecodePrefetches() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
validate()
Performs validation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Disables disk cache for this request, regardless where the image will come from.
Creates a new request builder instance with the same parameters as the imageRequest passed in.
imageRequest | the ImageRequest from where to copy the parameters to the builder. |
---|
Gets the lowest permitted request level.
Gets the source Uri.
Returns whether the use of the disk cache is enabled, which is partly dependent on the URI.
Returns whether the use of local thumbnails for previews is enabled.
Returns whether the use of the memory cache is enabled.
Returns whether progressive loading is enabled.
Creates a new request builder instance for a local resource image.
Only image resources can be used with the image pipeline (PNG, JPG, GIF). Other resource types such as Strings or XML Drawables make no sense in the context of the image pipeline and so cannot be supported. Attempts to do so will throw an java.lang.IllegalArgumentException when the pipeline tries to decode the resource.
One potentially confusing case is drawable declared in XML (e.g. ShapeDrawable). This is not an image. If you want to display an XML drawable as the main image, then set it as a placeholder and do not set a URI.
resId | local image resource id. |
---|
Creates a new request builder instance. The setting will be done according to the source type.
uri | the uri to fetch |
---|
This method is deprecated.
Use #setRotationOptions(RotationOptions)
Enables or disables auto-rotate for the image in case image has orientation.
Set the range of bytes to request from the network (in the case of an HTTP request). This is
only used if isPartialImageCachingEnabled()
is true and your
NetworkFetcher
makes use of it.
Even where this is supported, there is no contract that this must be followed. The response may contain the full image data, more than is requested or less, depending on what's already in cache and external factors.
bytesRange | the range of bytes |
---|
Sets the cache option. Pipeline might use different caches and eviction policies for each image type.
cacheChoice | the cache choice to set |
---|
Add an artificial delay for this image, in milliseconds.
Enables or disables the use of local thumbnails as previews.
Sets the lowest level that is permitted to request the image from.
requestLevel | the lowest request level that is allowed |
---|
Sets the postprocessor.
postprocessor | postprocessor to postprocess the output bitmap with. |
---|
Enables or disables progressive rendering.
Sets a request listener to use for just this image request
requestListener | a request listener to use in addition to the global ones set in the
ImagePipelineConfig |
---|
Set priority for the request.
Sets resize options in case resize should be performed.
resizeOptions | resize options |
---|
Sets rotation options for the image, whether to rotate by a multiple of 90 degrees, use the EXIF metadata (relevant to JPEGs only) or to not rotate. This also specifies whether the rotation should be left until the bitmap is rendered (as the GPU can do this more efficiently than the effort to change the bitmap object).
rotationOptions | rotation options |
---|
Sets the source uri (both network and local uris are supported). Note: this will enable disk caching for network sources, and disable it for local sources.
uri | the uri to fetch the image from |
---|
Performs validation.