private void setupGlide() { MemorySizeCalculator calculator = new MemorySizeCalculator(this); int defaultMemoryCacheSize = calculator.getMemoryCacheSize(); int defaultBitmapPoolSize = calculator.getBitmapPoolSize(); // disable the disk cache because all of our images are already cached on the sd card Glide.setup(new GlideBuilder(this) .setDiskCache(new DiskCacheAdapter()) .setBitmapPool(new LruBitmapPool(defaultBitmapPoolSize)) .setMemoryCache(new LruResourceCache(defaultMemoryCacheSize)) ); }
@Override public DiskCache build() { return new DiskCacheAdapter(); }