@UnstableApi
public interface BitmapLoader

Known direct subclasses
BitmapLoader

This interface is deprecated.

Use androidx.media3.common.util.BitmapLoader instead.

CacheBitmapLoader

A BitmapLoader that caches the result of the last decodeBitmap or loadBitmap request.

DataSourceBitmapLoader

A BitmapLoader implementation that uses a DataSource to support fetching images from URIs and BitmapFactory to load them into Bitmap.

SimpleBitmapLoader

This class is deprecated.

Use androidx.media3.datasource.DataSourceBitmapLoader instead.


Loads images.

Summary

Public methods

abstract ListenableFuture<Bitmap>
decodeBitmap(byte[] data)

Decodes an image from compressed binary data.

abstract ListenableFuture<Bitmap>

Loads an image from uri.

default @Nullable ListenableFuture<Bitmap>

Loads an image from MediaMetadata.

abstract boolean

Returns whether the given mimeType is supported.

Public methods

decodeBitmap

abstract ListenableFuture<BitmapdecodeBitmap(byte[] data)

Decodes an image from compressed binary data.

loadBitmap

abstract ListenableFuture<BitmaploadBitmap(Uri uri)

Loads an image from uri.

loadBitmapFromMetadata

default @Nullable ListenableFuture<BitmaploadBitmapFromMetadata(MediaMetadata metadata)

Loads an image from MediaMetadata. Returns null if metadata doesn't contain bitmap information.

By default, the method will try to decode an image from artworkData if it is present. Otherwise, the method will try to load an image from artworkUri if it is present. The method will return null if neither artworkData nor artworkUri is present.

supportsMimeType

abstract boolean supportsMimeType(String mimeType)

Returns whether the given mimeType is supported.