DataSourceBitmapLoader
@UnstableApi
public final class DataSourceBitmapLoader implements BitmapLoader
A BitmapLoader implementation that uses a DataSource to support fetching images from URIs and BitmapFactory to load them into Bitmap.
Loading tasks are delegated to a ListeningExecutorService defined during construction. If no executor service is passed, all tasks are delegated to a single-thread executor service that is shared between instances of this class.
Summary
Nested types |
|---|
public final class DataSourceBitmapLoader.BuilderA builder for |
Constants |
|
|---|---|
static final Supplier<ListeningExecutorService> |
Public constructors |
|---|
This method is deprecated. Use |
This method is deprecated. Use |
This method is deprecated. Use |
This method is deprecated. Use |
This method is deprecated. Use |
Public methods |
|
|---|---|
ListenableFuture<Bitmap> |
decodeBitmap(byte[] data)Decodes an image from compressed binary data. |
ListenableFuture<Bitmap> |
loadBitmap(Uri uri)Loads an image from |
boolean |
supportsMimeType(String mimeType)Returns whether the given |
Inherited methods |
||
|---|---|---|
|
Constants
DEFAULT_EXECUTOR_SERVICE
public static final Supplier<ListeningExecutorService> DEFAULT_EXECUTOR_SERVICE
Public constructors
DataSourceBitmapLoader
publicDataSourceBitmapLoader(
ListeningExecutorService listeningExecutorService,
DataSource.Factory dataSourceFactory
)
DataSourceBitmapLoader
publicDataSourceBitmapLoader(
ListeningExecutorService listeningExecutorService,
DataSource.Factory dataSourceFactory,
@Nullable BitmapFactory.Options options
)
DataSourceBitmapLoader
publicDataSourceBitmapLoader(
ListeningExecutorService listeningExecutorService,
DataSource.Factory dataSourceFactory,
@Nullable BitmapFactory.Options options,
int maximumOutputDimension
)
Public methods
decodeBitmap
public ListenableFuture<Bitmap> decodeBitmap(byte[] data)
Decodes an image from compressed binary data.
supportsMimeType
public boolean supportsMimeType(String mimeType)
Returns whether the given mimeType is supported.