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 String getId()
abstract ImageRequest getImageRequest()
abstract ProducerListener getListener()
abstract ImageRequest.RequestLevel getLowestPermittedRequestLevel()
abstract Priority getPriority()
abstract boolean isIntermediateResultExpected()
abstract boolean isPrefetch()

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 String getId ()

Returns
  • id of this request

public abstract ImageRequest getImageRequest ()

Returns
  • image request that is being executed

public abstract ProducerListener getListener ()

Returns
  • ProducerListener for producer's events

public abstract ImageRequest.RequestLevel getLowestPermittedRequestLevel ()

Returns

public abstract Priority getPriority ()

Returns
  • priority of the request.

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.