public abstract class

BaseBitmapReferenceDataSubscriber

extends BaseDataSubscriber<T>
java.lang.Object
   ↳ com.facebook.datasource.BaseDataSubscriber<T>
     ↳ com.facebook.imagepipeline.datasource.BaseBitmapReferenceDataSubscriber

Class Overview

Implementation of DataSubscriber for cases where the client wants access to a bitmap reference.

Sample usage:

 
 dataSource.subscribe(
   new BaseBitmapReferenceDataSubscriber() {
     @Override
     public void onNewResultImpl(@Nullable CloseableReference bitmapReference) {
       // Pass bitmap to another component, which clones the bitmap reference if it needs to
       // hold on to the bitmap.
       doSomething(bitmapReference);
       // No need to do any cleanup.
     }

     @Override
     public void onFailureImpl(DataSource dataSource) {
       // No cleanup required here.
     }
   });
 
 

Summary

Public Constructors
BaseBitmapReferenceDataSubscriber()
Public Methods
void onNewResultImpl(DataSource<CloseableReference<CloseableImage>> dataSource)
Protected Methods
abstract void onNewResultImpl(CloseableReference<Bitmap> bitmapReference)
The bitmap reference will be closed immediately after this method is called.
[Expand]
Inherited Methods
From class com.facebook.datasource.BaseDataSubscriber
From class java.lang.Object
From interface com.facebook.datasource.DataSubscriber

Public Constructors

public BaseBitmapReferenceDataSubscriber ()

Public Methods

public void onNewResultImpl (DataSource<CloseableReference<CloseableImage>> dataSource)

Protected Methods

protected abstract void onNewResultImpl (CloseableReference<Bitmap> bitmapReference)

The bitmap reference will be closed immediately after this method is called. Clone the reference if you need to hold on to the bitmap and close once no longer needed.

Parameters
bitmapReference the bitmap reference or null if not a bitmap-based image