glide
glide copied to clipboard
Caching to memory both thumbnail and original size image
Hi, I'd like to ask is it possible when requesting smaller version of an image (say 200x100) to also cache together with it the original version (say 2000x1000) in memory so that it's ready to be displayed on click? Otherwise you get a short blink as it tries to read the big image from the disk cache (that is, it's not in memory yet). What's the best approach here? My goal is to create a simple gallery-like app like Android's photos where on clicking the thumbnail you get the original image displayed right away (no blinking or delays, probably it's loaded from memory at this point).
Looking at the source code width and height properties are always used in the cache key. But I can't know the dimensions of the view for the big image as it's displayed on separate fragment.