MemoryCacheAdapter

open class MemoryCacheAdapter : MemoryCache

A simple class that ignores all puts and returns null for all gets.

Functions

Link copied to clipboard
open fun clearMemory()
Evict all items from the memory cache.
Link copied to clipboard
open fun getCurrentSize(): Long
Returns the sum of the sizes of all the contents of the cache in bytes.
Link copied to clipboard
open fun getMaxSize(): Long
Returns the current maximum size in bytes of the cache.
Link copied to clipboard
open fun put(key: Key, resource: Resource<out Any>): Resource<out Any>
Add bitmap to the cache with the given key.
Link copied to clipboard
open fun remove(key: Key): Resource<out Any>
Removes the value for the given key and returns it if present or null otherwise.
Link copied to clipboard
open fun setResourceRemovedListener(listener: MemoryCache.ResourceRemovedListener)
Set the listener to be called when a bitmap is removed from the cache.
Link copied to clipboard
open fun setSizeMultiplier(multiplier: Float)
Adjust the maximum size of the cache by multiplying the original size of the cache by the given multiplier.
Link copied to clipboard
open fun trimMemory(level: Int)
Trim the memory cache to the appropriate level.