Skip to content

Instantly share code, notes, and snippets.

@HugoGresse
Created November 19, 2015 10:14
Show Gist options
  • Save HugoGresse/b196f6156d7d6e84d710 to your computer and use it in GitHub Desktop.
Save HugoGresse/b196f6156d7d6e84d710 to your computer and use it in GitHub Desktop.
Fresco custom initialize with disk cache
/**
* Configure fresco using ONLY disk cache
*/
public void configFresco() {
Supplier<File> diskSupplier = new Supplier<File>() {
public File get() {
return getApplicationContext().getCacheDir();
}
};
DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder()
.setBaseDirectoryName("images")
.setBaseDirectoryPathSupplier(diskSupplier)
.build();
ImagePipelineConfig frescoConfig = ImagePipelineConfig.newBuilder(this)
.setMainDiskCacheConfig(diskCacheConfig)
.build();
Fresco.initialize(this, frescoConfig);
}
Copy link

ghost commented Dec 15, 2019

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment