本文整理汇总了Java中com.bumptech.glide.load.engine.cache.DiskCacheAdapter类的典型用法代码示例。如果您正苦于以下问题:Java DiskCacheAdapter类的具体用法?Java DiskCacheAdapter怎么用?Java DiskCacheAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DiskCacheAdapter类属于com.bumptech.glide.load.engine.cache包,在下文中一共展示了DiskCacheAdapter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupGlide
import com.bumptech.glide.load.engine.cache.DiskCacheAdapter; //导入依赖的package包/类
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))
);
}
示例2: build
import com.bumptech.glide.load.engine.cache.DiskCacheAdapter; //导入依赖的package包/类
@Override
public DiskCache build() {
return new DiskCacheAdapter();
}