Stay organized with collections Save and categorize content based on your preferences.

SimpleBitmapLoader

@UnstableApi
public final class SimpleBitmapLoader implements BitmapLoader


A simple bitmap loader that delegates all tasks to an executor and supports fetching images from URIs with file, http and https schemes.

Loading tasks are delegated to an ExecutorService (or ) defined during construction. If no executor service is defined, all tasks are delegated to a single-thread executor service that is shared between instances of this class.

For HTTP(S) transfers, this class reads a resource only when the endpoint responds with an HTTP 200 after sending the HTTP request.

Summary

Public constructors

Creates an instance that delegates all load tasks to a single-thread executor service shared between instances.

Creates an instance that delegates loading tasks to the executorService.

Public methods

ListenableFuture<Bitmap>
decodeBitmap(byte[] data)

Decodes an image from compressed binary data.

ListenableFuture<Bitmap>

Loads an image from uri.

Public constructors

SimpleBitmapLoader

public SimpleBitmapLoader()

Creates an instance that delegates all load tasks to a single-thread executor service shared between instances.

SimpleBitmapLoader

public SimpleBitmapLoader(ExecutorService executorService)

Creates an instance that delegates loading tasks to the executorService.

Public methods

decodeBitmap

public ListenableFuture<BitmapdecodeBitmap(byte[] data)

Decodes an image from compressed binary data.

loadBitmap

public ListenableFuture<BitmaploadBitmap(Uri uri)

Loads an image from uri.