public class

PipelineDraweeController

extends AbstractDraweeController<T, INFO>
java.lang.Object
   ↳ com.facebook.drawee.controller.AbstractDraweeController<T, INFO>
     ↳ com.facebook.drawee.backends.pipeline.PipelineDraweeController

Class Overview

Drawee controller that bridges the image pipeline with SettableDraweeHierarchy.

The hierarchy's actual image is set to the image(s) obtained by the provided data source. The data source is automatically obtained and closed based on attach / detach calls.

Summary

Public Constructors
PipelineDraweeController(Resources resources, DeferredReleaser deferredReleaser, DrawableFactory animatedDrawableFactory, Executor uiThreadExecutor, MemoryCache<CacheKeyCloseableImage> memoryCache, ImmutableList<DrawableFactory> globalDrawableFactories)
Public Methods
synchronized void addImageOriginListener(ImageOriginListener imageOriginListener)
synchronized void addRequestListener(RequestListener requestListener)
synchronized RequestListener getRequestListener()
void initialize(Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier, String id, CacheKey cacheKey, Object callerContext, ImmutableList<DrawableFactory> customDrawableFactories, ImageOriginListener imageOriginListener)
Initializes this controller with the new data source supplier, id and caller context.
boolean isSameImageRequest(DraweeController other)
synchronized void removeImageOriginListener(ImageOriginListener imageOriginListener)
synchronized void removeRequestListener(RequestListener requestListener)
void setCustomDrawableFactories(ImmutableList<DrawableFactory> customDrawableFactories)
void setDrawDebugOverlay(boolean drawDebugOverlay)
void setHierarchy(DraweeHierarchy hierarchy)
Sets the hierarchy.
String toString()
Protected Methods
void clearImageOriginListeners()
Drawable createDrawable(CloseableReference<CloseableImage> image)
CacheKey getCacheKey()
CloseableReference<CloseableImage> getCachedImage()
DataSource<CloseableReference<CloseableImage>> getDataSource()
Supplier<DataSource<CloseableReference<CloseableImage>>> getDataSourceSupplier()
int getImageHash(CloseableReference<CloseableImage> image)
ImageInfo getImageInfo(CloseableReference<CloseableImage> image)
Resources getResources()
synchronized void initializePerformanceMonitoring(ImagePerfDataListener imagePerfDataListener)
void onImageLoadedFromCacheImmediately(String id, CloseableReference<CloseableImage> cachedImage)
void releaseDrawable(Drawable drawable)
void releaseImage(CloseableReference<CloseableImage> image)
[Expand]
Inherited Methods
From class com.facebook.drawee.controller.AbstractDraweeController
From class java.lang.Object
From interface com.facebook.drawee.components.DeferredReleaser.Releasable
From interface com.facebook.drawee.gestures.GestureDetector.ClickListener
From interface com.facebook.drawee.interfaces.DraweeController

Public Constructors

public PipelineDraweeController (Resources resources, DeferredReleaser deferredReleaser, DrawableFactory animatedDrawableFactory, Executor uiThreadExecutor, MemoryCache<CacheKeyCloseableImage> memoryCache, ImmutableList<DrawableFactory> globalDrawableFactories)

Public Methods

public synchronized void addImageOriginListener (ImageOriginListener imageOriginListener)

public synchronized void addRequestListener (RequestListener requestListener)

public synchronized RequestListener getRequestListener ()

public void initialize (Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier, String id, CacheKey cacheKey, Object callerContext, ImmutableList<DrawableFactory> customDrawableFactories, ImageOriginListener imageOriginListener)

Initializes this controller with the new data source supplier, id and caller context. This allows for reusing of the existing controller instead of instantiating a new one. This method should be called when the controller is in detached state.

Parameters
dataSourceSupplier data source supplier
id unique id for this controller
callerContext tag and context for this controller

public boolean isSameImageRequest (DraweeController other)

public synchronized void removeImageOriginListener (ImageOriginListener imageOriginListener)

public synchronized void removeRequestListener (RequestListener requestListener)

public void setCustomDrawableFactories (ImmutableList<DrawableFactory> customDrawableFactories)

public void setDrawDebugOverlay (boolean drawDebugOverlay)

public void setHierarchy (DraweeHierarchy hierarchy)

Sets the hierarchy.

The controller should be detached when this method is called.

Parameters
hierarchy This must be an instance of SettableDraweeHierarchy

public String toString ()

Protected Methods

protected void clearImageOriginListeners ()

protected Drawable createDrawable (CloseableReference<CloseableImage> image)

protected CacheKey getCacheKey ()

protected CloseableReference<CloseableImage> getCachedImage ()

protected DataSource<CloseableReference<CloseableImage>> getDataSource ()

protected Supplier<DataSource<CloseableReference<CloseableImage>>> getDataSourceSupplier ()

protected int getImageHash (CloseableReference<CloseableImage> image)

protected ImageInfo getImageInfo (CloseableReference<CloseableImage> image)

protected Resources getResources ()

protected synchronized void initializePerformanceMonitoring (ImagePerfDataListener imagePerfDataListener)

protected void onImageLoadedFromCacheImmediately (String id, CloseableReference<CloseableImage> cachedImage)

protected void releaseDrawable (Drawable drawable)

protected void releaseImage (CloseableReference<CloseableImage> image)