UIL always check caches before displaying. So there is no way to avoid without changins the sources.
But I think you can solve your problem by extending disk cache. The goal is to return non-existing file from get()
method when you want to load full-sized image.
So you should do as usual to load thumbnails. When you need to display full-sized image you should disable caching on disk in display options (DisplayImageOptions
) and then do something like this:
((MyDiscCache) imageLoader.getDiscCache()).setIgnoreDiskCache(true);
So your cache must return any non-existing file (but not null).
When you return to display thumbnails you should "enable" (setIgnoreDiskCache(false)
) disk cache back.
UPD:
Create your own disk cache and set it to config.
public class MyDiscCache extends UnlimitedDiscCache {
private boolean ignoreDiskCache;
public MyDiscCache(File cacheDir) {
super(cacheDir);
}
public MyDiscCache(File cacheDir, FileNameGenerator fileNameGenerator) {
super(cacheDir, fileNameGenerator);
}
@Override
public File get(String key) {
if (ignoreDiskCache) {
return new File("fakePath");
} else {
return super.get(key);
}
}
public void setIgnoreDiskCache(boolean ignoreDiskCache) {
this.ignoreDiskCache = ignoreDiskCache;
}
}