I used the `Glide library with AppGlideModule, version of library 4.1.1. Here is my glide module class:
@GlideModule
public class GlideUtil extends AppGlideModule {
private final int IMAGE_CACHE_SIZE = 20 * 1024 * 1024; // 20 MB
private final String IMAGE_FOLDER = "/User/Images";
@Override
public void applyOptions(Context context, GlideBuilder builder) {
RequestOptions requestOptions = new RequestOptions();
requestOptions.format(DecodeFormat.PREFER_ARGB_8888);
requestOptions.diskCacheStrategy(DiskCacheStrategy.ALL);
builder.setDefaultRequestOptions(requestOptions);
InternalCacheDiskCacheFactory factory = new InternalCacheDiskCacheFactory(context, IMAGE_FOLDER, IMAGE_CACHE_SIZE);
builder.setDiskCache(factory);
}
@Override
public boolean isManifestParsingEnabled() {
return false;
}
This code worked successfully. But when i updated version of glide library to 4.3.1
compile 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
in GlideUtil class i saw messages: "The result of format is not used", "The result of diskCacheStrategyis not used":
So, how to resolve this? And do the methods diskCacheStrategy
and format
work on Glide 4.3.1 ?