Created
January 31, 2018 21:14
-
-
Save DevPicon/e30a892d2240731fab6fce73974abe17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment