-
- All Implemented Interfaces:
-
com.facebook.fresco.middleware.HasExtraData,com.facebook.imagepipeline.producers.ProducerContext
public class BaseProducerContext implements ProducerContext
ProducerContext that can be cancelled. Exposes low level API to manipulate state of the ProducerContext.
-
-
Field Summary
Fields Modifier and Type Field Description public final static Set<String>INITIAL_KEYS
-
Constructor Summary
Constructors Constructor Description BaseProducerContext(ImageRequest imageRequest, String id, ProducerListener2 producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority, ImagePipelineConfigInterface imagePipelineConfig)BaseProducerContext(ImageRequest imageRequest, String id, String uiComponentId, Map<String, out Object> extras, ProducerListener2 producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority, ImagePipelineConfigInterface imagePipelineConfig)
-
Method Summary
Modifier and Type Method Description ImageRequestgetImageRequest()StringgetId()StringgetUiComponentId()ProducerListener2getProducerListener()ObjectgetCallerContext()ImageRequest.RequestLevelgetLowestPermittedRequestLevel()synchronized booleanisPrefetch()synchronized PrioritygetPriority()synchronized booleanisIntermediateResultExpected()synchronized booleanisCancelled()voidaddCallbacks(ProducerContextCallbacks callbacks)ImagePipelineConfigInterfacegetImagePipelineConfig()voidcancel()Cancels the request processing and calls appropriate callbacks. synchronized List<ProducerContextCallbacks>setIsPrefetchNoCallbacks(boolean isPrefetch)Changes isPrefetch property. synchronized List<ProducerContextCallbacks>setPriorityNoCallbacks(Priority priority)Changes priority. synchronized List<ProducerContextCallbacks>setIsIntermediateResultExpectedNoCallbacks(boolean isIntermediateResultExpected)Changes isIntermediateResultExpected property. synchronized List<ProducerContextCallbacks>cancelNoCallbacks()Marks this ProducerContext as cancelled. static voidcallOnCancellationRequested(@Nullable() List<ProducerContextCallbacks> callbacks)Calls {@code onCancellationRequested}on each element of the list.static voidcallOnIsPrefetchChanged(@Nullable() List<ProducerContextCallbacks> callbacks)Calls {@code onIsPrefetchChanged}on each element of the list.static voidcallOnIsIntermediateResultExpectedChanged(@Nullable() List<ProducerContextCallbacks> callbacks)Calls {@code onIsIntermediateResultExpected}on each element of the list.static voidcallOnPriorityChanged(@Nullable() List<ProducerContextCallbacks> callbacks)Calls {@code onPriorityChanged}on each element of the list.voidputExtra(String key, @Nullable() Object value)voidputExtras(@Nullable() Map<String, out Object> extras)<T> TgetExtra(String key)<E> EgetExtra(String key, @Nullable() E valueIfNotFound)Map<String, Object>getExtras()voidputOriginExtra(@Nullable() String origin, @Nullable() String subcategory)voidputOriginExtra(@Nullable() String origin)-
Methods inherited from class com.facebook.imagepipeline.producers.ProducerContext
addCallbacks, getCallerContext, getId, getImagePipelineConfig, getImageRequest, getLowestPermittedRequestLevel, getPriority, getProducerListener, getUiComponentId, isIntermediateResultExpected, isPrefetch, putOriginExtra -
Methods inherited from class com.facebook.fresco.middleware.HasExtraData
getExtra, getExtras, putExtra, putExtras -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BaseProducerContext
BaseProducerContext(ImageRequest imageRequest, String id, ProducerListener2 producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority, ImagePipelineConfigInterface imagePipelineConfig)
-
BaseProducerContext
BaseProducerContext(ImageRequest imageRequest, String id, String uiComponentId, Map<String, out Object> extras, ProducerListener2 producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority, ImagePipelineConfigInterface imagePipelineConfig)
-
-
Method Detail
-
getImageRequest
ImageRequest getImageRequest()
-
getUiComponentId
@Nullable() String getUiComponentId()
-
getProducerListener
ProducerListener2 getProducerListener()
-
getCallerContext
Object getCallerContext()
-
getLowestPermittedRequestLevel
ImageRequest.RequestLevel getLowestPermittedRequestLevel()
-
isPrefetch
synchronized boolean isPrefetch()
-
getPriority
synchronized Priority getPriority()
-
isIntermediateResultExpected
synchronized boolean isIntermediateResultExpected()
-
isCancelled
synchronized boolean isCancelled()
-
addCallbacks
void addCallbacks(ProducerContextCallbacks callbacks)
-
getImagePipelineConfig
ImagePipelineConfigInterface getImagePipelineConfig()
-
cancel
void cancel()
Cancels the request processing and calls appropriate callbacks.
-
setIsPrefetchNoCallbacks
@Nullable() synchronized List<ProducerContextCallbacks> setIsPrefetchNoCallbacks(boolean isPrefetch)
Changes isPrefetch property.
This method does not call any callbacks. Instead, caller of this method is responsible foriterating over returned list and calling appropriate method on each callback object. {@see * #callOnIsPrefetchChanged}
-
setPriorityNoCallbacks
@Nullable() synchronized List<ProducerContextCallbacks> setPriorityNoCallbacks(Priority priority)
Changes priority.
This method does not call any callbacks. Instead, caller of this method is responsible foriterating over returned list and calling appropriate method on each callback object. {@see * #callOnPriorityChanged}
-
setIsIntermediateResultExpectedNoCallbacks
@Nullable() synchronized List<ProducerContextCallbacks> setIsIntermediateResultExpectedNoCallbacks(boolean isIntermediateResultExpected)
Changes isIntermediateResultExpected property.
This method does not call any callbacks. Instead, caller of this method is responsible foriterating over returned list and calling appropriate method on each callback object. {@see * #callOnIntermediateResultChanged}
-
cancelNoCallbacks
@Nullable() synchronized List<ProducerContextCallbacks> cancelNoCallbacks()
Marks this ProducerContext as cancelled.
This method does not call any callbacks. Instead, caller of this method is responsible foriterating over returned list and calling appropriate method on each callback object. {@see * #callOnCancellationRequested}
-
callOnCancellationRequested
static void callOnCancellationRequested(@Nullable() List<ProducerContextCallbacks> callbacks)
Calls
{@code onCancellationRequested}on each element of the list. Does nothing if list == null
-
callOnIsPrefetchChanged
static void callOnIsPrefetchChanged(@Nullable() List<ProducerContextCallbacks> callbacks)
Calls
{@code onIsPrefetchChanged}on each element of the list. Does nothing if list == null
-
callOnIsIntermediateResultExpectedChanged
static void callOnIsIntermediateResultExpectedChanged(@Nullable() List<ProducerContextCallbacks> callbacks)
Calls
{@code onIsIntermediateResultExpected}on each element of the list. Does nothing if list== null
-
callOnPriorityChanged
static void callOnPriorityChanged(@Nullable() List<ProducerContextCallbacks> callbacks)
Calls
{@code onPriorityChanged}on each element of the list. Does nothing if list == null
-
putOriginExtra
void putOriginExtra(@Nullable() String origin, @Nullable() String subcategory)
-
putOriginExtra
void putOriginExtra(@Nullable() String origin)
-
-
-
-