java.lang.Object | |
↳ | com.facebook.imagepipeline.core.ImagePipeline |
The entry point for the image pipeline.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ImagePipeline(ProducerSequenceFactory producerSequenceFactory, Set<RequestListener> requestListeners, Set<RequestListener2> requestListener2s, Supplier<Boolean> isPrefetchEnabledSupplier, MemoryCache<CacheKey, CloseableImage> bitmapMemoryCache, MemoryCache<CacheKey, PooledByteBuffer> encodedMemoryCache, BufferedDiskCache mainBufferedDiskCache, BufferedDiskCache smallImageBufferedDiskCache, CacheKeyFactory cacheKeyFactory, ThreadHandoffProducerQueue threadHandoffProducerQueue, Supplier<Boolean> suppressBitmapPrefetchingSupplier, Supplier<Boolean> lazyDataSource, CallerContextVerifier callerContextVerifier, ImagePipelineConfig config) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
clearCaches()
Clear all the caches (memory and disk)
| ||||||||||
void |
clearDiskCaches()
Clear disk caches
| ||||||||||
void |
clearMemoryCaches()
Clear the memory caches
| ||||||||||
void |
evictFromCache(Uri uri)
If you have supplied your own cache key factory when configuring the pipeline, this method may
not work correctly.
| ||||||||||
void |
evictFromDiskCache(Uri uri)
If you have supplied your own cache key factory when configuring the pipeline, this method may
not work correctly.
| ||||||||||
void |
evictFromDiskCache(ImageRequest imageRequest)
Removes all images with the specified Uri from disk cache.
| ||||||||||
void |
evictFromMemoryCache(Uri uri)
Removes all images with the specified Uri from memory cache.
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchDecodedImage(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit, RequestListener requestListener)
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchDecodedImage(ImageRequest imageRequest, Object callerContext)
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchDecodedImage(ImageRequest imageRequest, Object callerContext, RequestListener requestListener)
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchDecodedImage(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit)
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchDecodedImage(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit, RequestListener requestListener, String uiComponentId)
Submits a request for execution and returns a DataSource representing the pending decoded
image(s).
| ||||||||||
DataSource<CloseableReference<PooledByteBuffer>> |
fetchEncodedImage(ImageRequest imageRequest, Object callerContext, RequestListener requestListener)
Submits a request for execution and returns a DataSource representing the pending encoded
image(s).
| ||||||||||
DataSource<CloseableReference<PooledByteBuffer>> |
fetchEncodedImage(ImageRequest imageRequest, Object callerContext)
Submits a request for execution and returns a DataSource representing the pending encoded
image(s).
| ||||||||||
DataSource<CloseableReference<CloseableImage>> |
fetchImageFromBitmapCache(ImageRequest imageRequest, Object callerContext)
Submits a request for bitmap cache lookup.
| ||||||||||
String |
generateUniqueFutureId()
Generates unique id for RequestFuture.
| ||||||||||
MemoryCache<CacheKey, CloseableImage> | getBitmapMemoryCache() | ||||||||||
CacheKey | getCacheKey(ImageRequest imageRequest, Object callerContext) | ||||||||||
CacheKeyFactory | getCacheKeyFactory() | ||||||||||
CloseableReference<CloseableImage> |
getCachedImage(CacheKey cacheKey)
Returns a reference to the cached image
| ||||||||||
RequestListener | getCombinedRequestListener(RequestListener listener) | ||||||||||
ImagePipelineConfig | getConfig() | ||||||||||
Supplier<DataSource<CloseableReference<CloseableImage>>> |
getDataSourceSupplier(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel requestLevel)
Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending results of the task.
| ||||||||||
Supplier<DataSource<CloseableReference<CloseableImage>>> |
getDataSourceSupplier(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel requestLevel, RequestListener requestListener)
Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending results of the task.
| ||||||||||
Supplier<DataSource<CloseableReference<CloseableImage>>> |
getDataSourceSupplier(ImageRequest imageRequest, Object callerContext, ImageRequest.RequestLevel requestLevel, RequestListener requestListener, String uiComponentId)
Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending results of the task.
| ||||||||||
Supplier<DataSource<CloseableReference<PooledByteBuffer>>> |
getEncodedImageDataSourceSupplier(ImageRequest imageRequest, Object callerContext)
Returns a DataSource supplier that will on get submit the request for execution and return a
DataSource representing the pending results of the task.
| ||||||||||
ProducerSequenceFactory | getProducerSequenceFactory() | ||||||||||
RequestListener | getRequestListenerForRequest(ImageRequest imageRequest, RequestListener requestListener) | ||||||||||
long |
getUsedDiskCacheSize()
Current disk caches size
| ||||||||||
boolean | hasCachedImage(CacheKey cacheKey) | ||||||||||
boolean |
isInBitmapMemoryCache(ImageRequest imageRequest)
Returns whether the image is stored in the bitmap memory cache.
| ||||||||||
boolean |
isInBitmapMemoryCache(Uri uri)
Returns whether the image is stored in the bitmap memory cache.
| ||||||||||
DataSource<Boolean> |
isInDiskCache(ImageRequest imageRequest)
Returns whether the image is stored in the disk cache.
| ||||||||||
DataSource<Boolean> |
isInDiskCache(Uri uri)
Returns whether the image is stored in the disk cache.
| ||||||||||
boolean |
isInDiskCacheSync(Uri uri)
Returns whether the image is stored in the disk cache.
| ||||||||||
boolean |
isInDiskCacheSync(Uri uri, ImageRequest.CacheChoice cacheChoice)
Returns whether the image is stored in the disk cache.
| ||||||||||
boolean |
isInDiskCacheSync(ImageRequest imageRequest)
Performs disk cache check synchronously.
| ||||||||||
boolean |
isInEncodedMemoryCache(Uri uri)
Returns whether the image is stored in the encoded memory cache.
| ||||||||||
boolean |
isInEncodedMemoryCache(ImageRequest imageRequest)
Returns whether the image is stored in the encoded memory cache.
| ||||||||||
Supplier<Boolean> | isLazyDataSource() | ||||||||||
boolean | isPaused() | ||||||||||
void | pause() | ||||||||||
DataSource<Void> | prefetchToBitmapCache(ImageRequest imageRequest, Object callerContext, RequestListener requestListener) | ||||||||||
DataSource<Void> |
prefetchToBitmapCache(ImageRequest imageRequest, Object callerContext)
Submits a request for prefetching to the bitmap cache.
| ||||||||||
DataSource<Void> | prefetchToDiskCache(ImageRequest imageRequest, Object callerContext, RequestListener requestListener) | ||||||||||
DataSource<Void> |
prefetchToDiskCache(ImageRequest imageRequest, Object callerContext, Priority priority)
Submits a request for prefetching to the disk cache.
| ||||||||||
DataSource<Void> | prefetchToDiskCache(ImageRequest imageRequest, Object callerContext, Priority priority, RequestListener requestListener) | ||||||||||
DataSource<Void> |
prefetchToDiskCache(ImageRequest imageRequest, Object callerContext)
Submits a request for prefetching to the disk cache with a default priority.
| ||||||||||
DataSource<Void> |
prefetchToEncodedCache(ImageRequest imageRequest, Object callerContext)
Submits a request for prefetching to the encoded cache with a default priority.
| ||||||||||
DataSource<Void> | prefetchToEncodedCache(ImageRequest imageRequest, Object callerContext, RequestListener requestListener) | ||||||||||
DataSource<Void> |
prefetchToEncodedCache(ImageRequest imageRequest, Object callerContext, Priority priority)
Submits a request for prefetching to the encoded cache.
| ||||||||||
DataSource<Void> | prefetchToEncodedCache(ImageRequest imageRequest, Object callerContext, Priority priority, RequestListener requestListener) | ||||||||||
void | resume() | ||||||||||
<T> DataSource<CloseableReference<T>> | submitFetchRequest(Producer<CloseableReference<T>> producerSequence, SettableProducerContext settableProducerContext, RequestListener requestListener) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Clear all the caches (memory and disk)
Clear disk caches
Clear the memory caches
If you have supplied your own cache key factory when configuring the pipeline, this method may
not work correctly. It will only work if the custom factory builds the cache key entirely from
the URI. If that is not the case, use evictFromMemoryCache(Uri)
and evictFromDiskCache(ImageRequest)
separately.
uri | The uri of the image to evict |
---|
If you have supplied your own cache key factory when configuring the pipeline, this method may
not work correctly. It will only work if the custom factory builds the cache key entirely from
the URI. If that is not the case, use evictFromDiskCache(ImageRequest)
.
uri | The uri of the image to evict |
---|
Removes all images with the specified Uri from disk cache.
imageRequest | The imageRequest for the image to evict from disk cache |
---|
Removes all images with the specified Uri from memory cache.
uri | The uri of the image to evict |
---|
Submits a request for execution and returns a DataSource representing the pending decoded image(s).
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
lowestPermittedRequestLevelOnSubmit | the lowest request level permitted for image reques |
requestListener | additional image request listener independent of ImageRequest listeners |
Submits a request for execution and returns a DataSource representing the pending decoded image(s).
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
Submits a request for execution and returns a DataSource representing the pending decoded image(s).
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
requestListener | additional image request listener independent of ImageRequest listeners |
Submits a request for execution and returns a DataSource representing the pending decoded image(s).
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
lowestPermittedRequestLevelOnSubmit | the lowest request level permitted for image request |
Submits a request for execution and returns a DataSource representing the pending decoded image(s).
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
lowestPermittedRequestLevelOnSubmit | the lowest request level permitted for image reques |
requestListener | additional image request listener independent of ImageRequest listeners |
uiComponentId | optional UI component ID that is requesting the image |
Submits a request for execution and returns a DataSource representing the pending encoded image(s).
The ResizeOptions in the imageRequest will be ignored for this fetch
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|
Submits a request for execution and returns a DataSource representing the pending encoded image(s).
The ResizeOptions in the imageRequest will be ignored for this fetch
The returned DataSource must be closed once the client has finished with it.
imageRequest | the request to submit |
---|
Submits a request for bitmap cache lookup.
imageRequest | the request to submit |
---|---|
callerContext | the caller context for image request |
Generates unique id for RequestFuture.
CacheKey
for doing bitmap cache lookups in the pipeline. Returns a reference to the cached image
Returns a DataSource supplier that will on get submit the request for execution and return a DataSource representing the pending results of the task.
imageRequest | the request to submit (what to execute). |
---|---|
callerContext | the caller context of the caller of data source supplier |
requestLevel | which level to look down until for the image |
Returns a DataSource supplier that will on get submit the request for execution and return a DataSource representing the pending results of the task.
imageRequest | the request to submit (what to execute). |
---|---|
callerContext | the caller context of the caller of data source supplier |
requestLevel | which level to look down until for the image |
requestListener | additional image request listener independent of ImageRequest listeners |
Returns a DataSource supplier that will on get submit the request for execution and return a DataSource representing the pending results of the task.
imageRequest | the request to submit (what to execute). |
---|---|
callerContext | the caller context of the caller of data source supplier |
requestLevel | which level to look down until for the image |
requestListener | additional image request listener independent of ImageRequest listeners |
uiComponentId | optional UI component ID requesting the image |
Returns a DataSource supplier that will on get submit the request for execution and return a DataSource representing the pending results of the task.
imageRequest | the request to submit (what to execute). |
---|
Current disk caches size
Returns whether the image is stored in the bitmap memory cache.
imageRequest | the imageRequest for the image to be looked up. |
---|
Returns whether the image is stored in the bitmap memory cache.
uri | the uri for the image to be looked up. |
---|
Returns whether the image is stored in the disk cache.
imageRequest | the imageRequest for the image to be looked up. |
---|
Returns whether the image is stored in the disk cache.
If you have supplied your own cache key factory when configuring the pipeline, this method
may not work correctly. It will only work if the custom factory builds the cache key entirely
from the URI. If that is not the case, use isInDiskCache(ImageRequest)
.
uri | the uri for the image to be looked up. |
---|
Returns whether the image is stored in the disk cache. Performs disk cache check synchronously. It is not recommended to use this unless you know what exactly you are doing. Disk cache check is a costly operation, the call will block the caller thread until the cache check is completed.
uri | the uri for the image to be looked up. |
---|
Returns whether the image is stored in the disk cache. Performs disk cache check synchronously. It is not recommended to use this unless you know what exactly you are doing. Disk cache check is a costly operation, the call will block the caller thread until the cache check is completed.
uri | the uri for the image to be looked up. |
---|---|
cacheChoice | the cacheChoice for the cache to be looked up. |
Performs disk cache check synchronously. It is not recommended to use this unless you know what exactly you are doing. Disk cache check is a costly operation, the call will block the caller thread until the cache check is completed.
imageRequest | the imageRequest for the image to be looked up. |
---|
Returns whether the image is stored in the encoded memory cache.
uri | the uri for the image to be looked up. |
---|
Returns whether the image is stored in the encoded memory cache.
imageRequest | the imageRequest for the image to be looked up. |
---|
Submits a request for prefetching to the bitmap cache.
Beware that if your network fetcher doesn't support priorities prefetch requests may slow down images which are immediately required on screen.
imageRequest | the request to submit |
---|
Submits a request for prefetching to the disk cache.
Beware that if your network fetcher doesn't support priorities prefetch requests may slow down images which are immediately required on screen.
imageRequest | the request to submit |
---|---|
priority | custom priority for the fetch |
Submits a request for prefetching to the disk cache with a default priority.
Beware that if your network fetcher doesn't support priorities prefetch requests may slow down images which are immediately required on screen.
imageRequest | the request to submit |
---|
Submits a request for prefetching to the encoded cache with a default priority.
Beware that if your network fetcher doesn't support priorities prefetch requests may slow down images which are immediately required on screen.
imageRequest | the request to submit |
---|
Submits a request for prefetching to the encoded cache.
Beware that if your network fetcher doesn't support priorities prefetch requests may slow down images which are immediately required on screen.
imageRequest | the request to submit |
---|---|
priority | custom priority for the fetch |