use new AppGlideModule class and update proguard rules
This commit is contained in:
parent
baab43f89d
commit
52986be353
5 changed files with 16 additions and 27 deletions
|
|
@ -8,18 +8,19 @@ import androidx.annotation.NonNull;
|
|||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.GlideBuilder;
|
||||
import com.bumptech.glide.Registry;
|
||||
import com.bumptech.glide.annotation.GlideModule;
|
||||
import com.bumptech.glide.load.DecodeFormat;
|
||||
import com.bumptech.glide.load.engine.cache.DiskLruCacheFactory;
|
||||
import com.bumptech.glide.module.GlideModule;
|
||||
import com.bumptech.glide.module.AppGlideModule;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.dkanada.gramophone.App;
|
||||
import com.dkanada.gramophone.glide.palette.BitmapPaletteTranscoder;
|
||||
import com.dkanada.gramophone.glide.palette.BitmapPaletteWrapper;
|
||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CustomGlideModule implements GlideModule {
|
||||
@GlideModule
|
||||
public class CustomGlideModule extends AppGlideModule {
|
||||
@Override
|
||||
public void applyOptions(@NonNull Context context, GlideBuilder builder) {
|
||||
File file = new File(context.getCacheDir() + "glide");
|
||||
|
|
@ -33,4 +34,9 @@ public class CustomGlideModule implements GlideModule {
|
|||
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
|
||||
registry.register(Bitmap.class, BitmapPaletteWrapper.class, new BitmapPaletteTranscoder(glide.getBitmapPool()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isManifestParsingEnabled() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class CustomGlideRequest {
|
|||
this.context = context;
|
||||
|
||||
if (placeholder != null) {
|
||||
Bitmap bitmap = BlurHashDecoder.INSTANCE.decode(placeholder, 20, 20, 1, true);
|
||||
Bitmap bitmap = BlurHashDecoder.INSTANCE.decode(placeholder, 40, 40, 1, true);
|
||||
BitmapDrawable drawable = new BitmapDrawable(context.getResources(), bitmap);
|
||||
requestManager.applyDefaultRequestOptions(createRequestOptions(item, drawable));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue