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
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
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.facebook.datasource.DataSubscriber
abstract
void
|
onCancellation(DataSource<T> dataSource)
Called whenever the request is cancelled (a request being cancelled means that is was closed
before it finished).
|
abstract
void
|
onFailure(DataSource<T> dataSource)
Called whenever an error occurs inside of the pipeline.
|
abstract
void
|
onNewResult(DataSource<T> dataSource)
Called whenever a new value is ready to be retrieved from the DataSource.
|
abstract
void
|
onProgressUpdate(DataSource<T> dataSource)
Called when the progress updates.
|
|
Public Constructors
public
BaseBitmapReferenceDataSubscriber
()
Public Methods
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
|