RequestKeypublic interface RequestKey The decode task uses this class to get input to decode. You must implement at least one of
{@link #createFileDescriptorFactoryAsync(RequestKey, Callback)} or {@link #createInputStream()}.
{@link DecodeTask} will prioritize
{@link #createFileDescriptorFactoryAsync(RequestKey, Callback)} before falling back to
{@link #createInputStream()}.
Clients of this interface must also implement {@link #equals(Object)} and {@link #hashCode()} as
this object will be used as a cache key.
The following is a high level view of the interactions between RequestKey and the rest of the
system.
BasicBitmapDrawable
UI Thread
++
bind() || Background Thread
|+-------------------->+
|| createFDFasync() ||
|| || Download from url
|| || Cache on disk
|| ||
|| vv
|<--------------------+x
|| FDFcreated()
||
||
|| DecodeTask
|| AsyncTask Thread
|+-------------------->+
|| new().execute() ||
|| || Decode from FDF
|| || or createInputStream()
|| ||
|| vv
|<--------------------+x
|| onDecodeComplete()
vv
invalidate() xx |
Methods Summary |
---|
public com.android.bitmap.RequestKey$Cancelable | createFileDescriptorFactoryAsync(com.android.bitmap.RequestKey key, com.android.bitmap.RequestKey$Callback callback)Create an {@link FileDescriptorFactory} for a local file stored on the device and pass it to
the given callback. This method will be called first; if it returns null,
{@link #createInputStream()} will be called.
Clients should implement this method if files are in the local cache folder, or if files must
be downloaded and cached.
This method must be called from the UI thread.
| public java.io.InputStream | createInputStream()Create an {@link InputStream} for the source. This method will be called if
{@link #createFileDescriptorFactoryAsync(RequestKey, Callback)} returns null.
Clients should implement this method if files exist in the assets/ folder, or for prototypes
that open a connection directly on a URL (be warned that this will cause GCs).
This method can be called from any thread.
| public boolean | hasOrientationExif()Return true if the image source may have be oriented in either portrait or landscape, and
will need to be automatically re-oriented based on accompanying Exif metadata.
This method can be called from any thread.
|
|