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

Nested types

A builder for DataSourceBitmapLoader instances.

Public constructors

This function is deprecated.

Use Builder instead.

DataSourceBitmapLoader(context: Context!, maximumOutputDimension: Int)

This function is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!
)

This function is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!,
    options: BitmapFactory.Options?
)

This function is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!,
    options: BitmapFactory.Options?,
    maximumOutputDimension: Int
)

This function is deprecated.

Use Builder instead.

Public functions

ListenableFuture<Bitmap!>!

Decodes an image from compressed binary data.

ListenableFuture<Bitmap!>!
loadBitmap(uri: Uri!)

Loads an image from uri.

Boolean

Returns whether the given mimeType is supported.

Constants

DEFAULT_EXECUTOR_SERVICE

const val DEFAULT_EXECUTOR_SERVICESupplier<ListeningExecutorService!>!

Public constructors

DataSourceBitmapLoader

DataSourceBitmapLoader(context: Context!)

DataSourceBitmapLoader

DataSourceBitmapLoader(context: Context!, maximumOutputDimension: Int)

DataSourceBitmapLoader

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!
)

DataSourceBitmapLoader

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!,
    options: BitmapFactory.Options?
)

DataSourceBitmapLoader

DataSourceBitmapLoader(
    listeningExecutorService: ListeningExecutorService!,
    dataSourceFactory: DataSource.Factory!,
    options: BitmapFactory.Options?,
    maximumOutputDimension: Int
)

Public functions

decodeBitmap

fun decodeBitmap(data: ByteArray!): ListenableFuture<Bitmap!>!

Decodes an image from compressed binary data.

loadBitmap

fun loadBitmap(uri: Uri!): ListenableFuture<Bitmap!>!

Loads an image from uri.

supportsMimeType

fun supportsMimeType(mimeType: String!): Boolean

Returns whether the given mimeType is supported.