public abstract class

BaseBitmapDataSubscriber

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

Class Overview

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

Sample usage:

 
 dataSource.subscribe(
   new BaseBitmapDataSubscriber() {
     @Override
     public void onNewResultImpl(@Nullable Bitmap bitmap) {
       // Pass bitmap to system, which makes a copy of the bitmap.
       updateStatus(bitmap);
       // No need to do any cleanup.
     }

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

Summary

Public Constructors
BaseBitmapDataSubscriber()
Public Methods
void onNewResultImpl(DataSource<CloseableReference<CloseableImage>> dataSource)
Protected Methods
abstract void onNewResultImpl(Bitmap bitmap)
The bitmap provided to this method is only guaranteed to be around for the lifespan of the method.
[Expand]
Inherited Methods
From class com.facebook.datasource.BaseDataSubscriber
From class java.lang.Object
From interface com.facebook.datasource.DataSubscriber

Public Constructors

public BaseBitmapDataSubscriber ()

Public Methods

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

Protected Methods

protected abstract void onNewResultImpl (Bitmap bitmap)

The bitmap provided to this method is only guaranteed to be around for the lifespan of the method.

The framework will free the bitmap's memory after this method has completed.