Glide Version 4 Initialize

build.gradle

dependencies {
  compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC1'
}

GlideConfig.java

@GlideModule
public final class GlideConfig extends AppGlideModule {

@Override
public void applyOptions(Context context, GlideBuilder builder) {

MemorySizeCalculator calculator = new MemorySizeCalculator.Builder(context)
.setMemoryCacheScreens(3)
.build();

int diskCacheSizeBytes = 1024 * 1024 * 100; // 100 MB

builder.setDiskCache(new InternalCacheDiskCacheFactory(context, diskCacheSizeBytes));
builder.setMemoryCache(new LruResourceCache(calculator.getMemoryCacheSize()));
}
}
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.