You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, thumbnails that appear on the metadata screen are cached on disk, using the decodeSampledBitmapAndCache() method from the BitmapReader class. This could be improved further by adding an intermediate layer of caching, in-memory LRU cache, implemented using the androidx.collection.LruCache class from AndroidX.
This cache could also be used for the blank Bitmap that currently gets created every time a mask is saved, here:
An additional requirement would be for this in-memory cache to react to low memory conditions. This can be achieved by overriding the onTrimMemory() method in the Application class, and depending on the level, evict an adequate number of bitmaps, using the trimToSize() method.
Right now, thumbnails that appear on the metadata screen are cached on disk, using the
decodeSampledBitmapAndCache()
method from theBitmapReader
class. This could be improved further by adding an intermediate layer of caching, in-memory LRU cache, implemented using theandroidx.collection.LruCache
class from AndroidX.This cache could also be used for the blank Bitmap that currently gets created every time a mask is saved, here:
GDD-app/app/src/main/java/net/aiscope/gdd_app/ui/mask/MaskActivity.kt
Line 199 in 20117b4
An additional requirement would be for this in-memory cache to react to low memory conditions. This can be achieved by overriding the
onTrimMemory()
method in theApplication
class, and depending on thelevel
, evict an adequate number of bitmaps, using thetrimToSize()
method.Relevant Android guide: https://developer.android.com/topic/performance/graphics/cache-bitmap#memory-cache
The text was updated successfully, but these errors were encountered: