public interface

ProducerContext

com.facebook.imagepipeline.producers.ProducerContext
Known Indirect Subclasses

Class Overview

Used to pass context information to producers.

Object implementing this interface is passed to all producers participating in pipeline request . Its responsibility is to instruct producers which image should be fetched/decoded/resized/cached etc. This class also handles request cancellation.

In order to be notified when cancellation is requested, a producer should use the runOnCancellationRequested method which takes an instance of Runnable and executes it when the pipeline client cancels the image request.

Summary

Public Methods
abstract void addCallbacks(ProducerContextCallbacks callbacks)
Adds callbacks to the set of callbacks that are executed at various points during the processing of a request.
abstract Object getCallerContext()
abstract EncodedImageOrigin getEncodedImageOrigin()
abstract String getId()
abstract ImagePipelineConfig getImagePipelineConfig()
abstract ImageRequest getImageRequest()
abstract ImageRequest.RequestLevel getLowestPermittedRequestLevel()
abstract Priority getPriority()
abstract ProducerListener2 getProducerListener()
abstract String getUiComponentId()
abstract boolean isIntermediateResultExpected()
abstract boolean isPrefetch()
abstract void setEncodedImageOrigin(EncodedImageOrigin encodedImageOrigin)

Public Methods

public abstract void addCallbacks (ProducerContextCallbacks callbacks)

Adds callbacks to the set of callbacks that are executed at various points during the processing of a request.

Parameters
callbacks callbacks to be executed

public abstract Object getCallerContext ()

Returns
  • the Object that indicates the caller's context

public abstract EncodedImageOrigin getEncodedImageOrigin ()

public abstract String getId ()

Returns
  • id of this request

public abstract ImagePipelineConfig getImagePipelineConfig ()

public abstract ImageRequest getImageRequest ()

Returns
  • image request that is being executed

public abstract ImageRequest.RequestLevel getLowestPermittedRequestLevel ()

Returns

public abstract Priority getPriority ()

Returns
  • priority of the request.

public abstract ProducerListener2 getProducerListener ()

Returns
  • ProducerListener2 for producer's events

public abstract String getUiComponentId ()

Returns
  • optional id of the UI component requesting the image

public abstract boolean isIntermediateResultExpected ()

Returns
  • true if request's owner expects intermediate results

public abstract boolean isPrefetch ()

Returns
  • true if the request is a prefetch, false otherwise.

public abstract void setEncodedImageOrigin (EncodedImageOrigin encodedImageOrigin)