DataSourceBitmapLoader
@UnstableApi
class DataSourceBitmapLoader : 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
Constants |
|
---|---|
const Supplier<ListeningExecutorService!>! |
Public constructors |
---|
DataSourceBitmapLoader(context: Context!) Creates an instance that uses a |
DataSourceBitmapLoader( Creates an instance that delegates loading tasks to the |
DataSourceBitmapLoader( Creates an instance that delegates loading tasks to the |
DataSourceBitmapLoader( Creates an instance that delegates loading tasks to the |
Public functions |
|
---|---|
ListenableFuture<Bitmap!>! |
decodeBitmap(data: ByteArray!) Decodes an image from compressed binary data. |
ListenableFuture<Bitmap!>! |
loadBitmap(uri: Uri!) Loads an image from |
Boolean |
supportsMimeType(mimeType: String!) Returns whether the given |
Inherited functions |
||
---|---|---|
|
Constants
Public constructors
DataSourceBitmapLoader
DataSourceBitmapLoader(context: Context!)
Creates an instance that uses a DefaultHttpDataSource
for image loading and delegates loading tasks to a newSingleThreadExecutor
.
DataSourceBitmapLoader
DataSourceBitmapLoader(
listeningExecutorService: ListeningExecutorService!,
dataSourceFactory: DataSource.Factory!
)
Creates an instance that delegates loading tasks to the ListeningExecutorService
.
Parameters | |
---|---|
listeningExecutorService: ListeningExecutorService! |
|
dataSourceFactory: DataSource.Factory! |
The |
DataSourceBitmapLoader
DataSourceBitmapLoader(
listeningExecutorService: ListeningExecutorService!,
dataSourceFactory: DataSource.Factory!,
options: BitmapFactory.Options?
)
Creates an instance that delegates loading tasks to the ListeningExecutorService
.
Parameters | |
---|---|
listeningExecutorService: ListeningExecutorService! |
|
dataSourceFactory: DataSource.Factory! |
The |
options: BitmapFactory.Options? |
The |
DataSourceBitmapLoader
DataSourceBitmapLoader(
listeningExecutorService: ListeningExecutorService!,
dataSourceFactory: DataSource.Factory!,
options: BitmapFactory.Options?,
maximumOutputDimension: Int
)
Creates an instance that delegates loading tasks to the ListeningExecutorService
.
Use maximumOutputDimension
to limit memory usage when loading large Bitmaps.
Parameters | |
---|---|
listeningExecutorService: ListeningExecutorService! |
|
dataSourceFactory: DataSource.Factory! |
The |
options: BitmapFactory.Options? |
The |
maximumOutputDimension: Int |
The maximum dimension of the output Bitmap. |
Public functions
decodeBitmap
fun decodeBitmap(data: ByteArray!): ListenableFuture<Bitmap!>!
Decodes an image from compressed binary data.
supportsMimeType
fun supportsMimeType(mimeType: String!): Boolean
Returns whether the given mimeType
is supported.