InterceptorsBuilder
class InterceptorsBuilder
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Any> anyMemoryCache(mapToMemoryValue: (ImageResult) -> T?, mapToImageResult: (T) -> ImageResult?, block: () -> MemoryCache<MemoryKey, T>)
Link copied to clipboard
fun InterceptorsBuilder.defaultImageResultMemoryCache(includeBitmap: Boolean = false, saveSize: Int = 100, valueHashProvider: (ImageResult) -> Int = { it.hashCode() }, valueSizeProvider: (ImageResult) -> Int = { 1 }, mapToMemoryValue: (ImageResult) -> ImageResult? = {
when (it) {
is ImageResult.OfImage,
is ImageResult.OfPainter,
-> it
is ImageResult.OfBitmap -> if (includeBitmap) it else null
is ImageResult.OfSource,
is ImageResult.OfError,
-> null
}
}, mapToImageResult: (ImageResult) -> ImageResult? = { it })
Link copied to clipboard
fun diskCacheConfig(fileSystem: FileSystem? = defaultFileSystem, block: DiskCacheBuilder.() -> Unit)
Link copied to clipboard
fun memoryCache(mapToMemoryValue: (ImageResult) -> Bitmap? = { (it as? ImageResult.OfBitmap)?.bitmap }, mapToImageResult: (Bitmap) -> ImageResult? = { ImageResult.OfBitmap(it) }, block: () -> MemoryCache<MemoryKey, Bitmap>)
Link copied to clipboard
fun memoryCacheConfig(valueHashProvider: (Bitmap) -> Int = { it.identityHashCode }, valueSizeProvider: (Bitmap) -> Int = { it.size }, block: MemoryCacheBuilder<MemoryKey, Bitmap>.() -> Unit)
Link copied to clipboard
fun takeFrom(interceptors: Interceptors, clearInterceptors: Boolean = false, clearMemoryCaches: Boolean = false)