use new AppGlideModule class and update proguard rules

This commit is contained in:
dkanada 2020-10-31 19:11:40 +09:00
commit 52986be353
5 changed files with 16 additions and 27 deletions

View file

@ -76,12 +76,6 @@
<meta-data
android:name="com.lge.support.SPLIT_WINDOW"
android:value="true" />
<meta-data
android:name="com.dkanada.gramophone.glide.CustomGlideModule"
android:value="GlideModule" />
<meta-data
android:name="com.bumptech.glide.integration.okhttp3.OkHttpGlideModule"
android:value="GlideModule" />
<receiver android:name=".widgets.BootReceiver">
<intent-filter>

View file

@ -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;
}
}

View file

@ -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 {