Skip to content

Instantly share code, notes, and snippets.

@HugoGresse
Created November 19, 2015 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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);
}
@mehrdadf7
Copy link

mehrdadf7 commented Jun 14, 2019

Thank You, it's useful for me

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