mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
33 lines
974 B
Java
33 lines
974 B
Java
|
package org.thoughtcrime.securesms.mms;
|
||
|
|
||
|
import android.content.Context;
|
||
|
|
||
|
import com.bumptech.glide.Glide;
|
||
|
import com.bumptech.glide.GlideBuilder;
|
||
|
import com.bumptech.glide.load.engine.cache.DiskCache;
|
||
|
import com.bumptech.glide.load.engine.cache.DiskCacheAdapter;
|
||
|
import com.bumptech.glide.module.GlideModule;
|
||
|
|
||
|
import org.thoughtcrime.securesms.mms.DecryptableStreamUriLoader.DecryptableUri;
|
||
|
|
||
|
import java.io.InputStream;
|
||
|
|
||
|
public class TextSecureGlideModule implements GlideModule {
|
||
|
@Override
|
||
|
public void applyOptions(Context context, GlideBuilder builder) {
|
||
|
builder.setDiskCache(new NoopDiskCacheFactory());
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void registerComponents(Context context, Glide glide) {
|
||
|
glide.register(DecryptableUri.class, InputStream.class, new DecryptableStreamUriLoader.Factory());
|
||
|
}
|
||
|
|
||
|
public static class NoopDiskCacheFactory implements DiskCache.Factory {
|
||
|
@Override
|
||
|
public DiskCache build() {
|
||
|
return new DiskCacheAdapter();
|
||
|
}
|
||
|
}
|
||
|
}
|