FakeBitmapLoader


@UnstableApi
class FakeBitmapLoader : BitmapLoader


A fake BitmapLoader that returns result for every decodeBitmap and loadBitmap call, and counts the calls.

Summary

Public constructors

Creates an instance that returns bitmap for every call.

Creates an instance that fails with throwable for every call.

Public functions

open ListenableFuture<Bitmap>

Decodes an image from compressed binary data.

open ListenableFuture<Bitmap>

Loads an image from uri.

open Boolean

Returns whether the given mimeType is supported.

Public properties

Int

The number of times decodeBitmap has been called.

Int

The number of times loadBitmap has been called.

Public constructors

FakeBitmapLoader

FakeBitmapLoader(bitmap: Bitmap)

Creates an instance that returns bitmap for every call.

FakeBitmapLoader

FakeBitmapLoader(result: ListenableFuture<Bitmap>)
Parameters
result: ListenableFuture<Bitmap>

The result returned for every call.

FakeBitmapLoader

FakeBitmapLoader(throwable: Throwable)

Creates an instance that fails with throwable for every call.

Public functions

decodeBitmap

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

Decodes an image from compressed binary data.

loadBitmap

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

Loads an image from uri.

supportsMimeType

open fun supportsMimeType(mimeType: String): Boolean

Returns whether the given mimeType is supported.

Public properties

decodeBitmapCallCount

val decodeBitmapCallCount: Int

The number of times decodeBitmap has been called.

loadBitmapCallCount

val loadBitmapCallCount: Int

The number of times loadBitmap has been called.