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
|
|
@ -21,7 +21,7 @@ android {
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
|
|
@ -63,7 +63,7 @@ dependencies {
|
||||||
implementation 'androidx.annotation:annotation:1.1.0'
|
implementation 'androidx.annotation:annotation:1.1.0'
|
||||||
implementation 'androidx.percentlayout:percentlayout:1.0.0'
|
implementation 'androidx.percentlayout:percentlayout:1.0.0'
|
||||||
implementation 'androidx.preference:preference:1.1.1'
|
implementation 'androidx.preference:preference:1.1.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
|
|
||||||
implementation 'com.github.kabouzeid:app-theme-helper:1.3.10'
|
implementation 'com.github.kabouzeid:app-theme-helper:1.3.10'
|
||||||
implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
|
implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
|
||||||
|
|
@ -81,6 +81,8 @@ dependencies {
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
|
|
||||||
|
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
||||||
|
implementation 'com.github.bumptech.glide:annotations:4.11.0'
|
||||||
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
||||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
|
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
17
app/proguard-rules.pro
vendored
17
app/proguard-rules.pro
vendored
|
|
@ -3,29 +3,16 @@
|
||||||
|
|
||||||
# RetroFit
|
# RetroFit
|
||||||
-dontwarn retrofit.**
|
-dontwarn retrofit.**
|
||||||
-keep class retrofit.** { *; }
|
|
||||||
-keepattributes Signature
|
-keepattributes Signature
|
||||||
-keepattributes Exceptions
|
-keepattributes Exceptions
|
||||||
|
|
||||||
# Glide
|
# Glide
|
||||||
-keep public class * implements com.bumptech.glide.module.GlideModule
|
-keep public class * extends com.bumptech.glide.module.AppGlideModule
|
||||||
|
-keep class com.bumptech.glide.GeneratedAppGlideModuleImpl
|
||||||
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
|
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
|
||||||
**[] $VALUES;
|
**[] $VALUES;
|
||||||
public *;
|
public *;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ButterKnife
|
|
||||||
-keep class butterknife.** { *; }
|
|
||||||
-dontwarn butterknife.internal.**
|
|
||||||
-keep class **$$ViewBinder { *; }
|
|
||||||
-keepclasseswithmembernames class * {
|
|
||||||
@butterknife.* <fields>;
|
|
||||||
}
|
|
||||||
-keepclasseswithmembernames class * {
|
|
||||||
@butterknife.* <methods>;
|
|
||||||
}
|
|
||||||
|
|
||||||
-keep class !android.support.v7.internal.view.menu.**,** {*;}
|
|
||||||
|
|
||||||
# Jellyfin API
|
# Jellyfin API
|
||||||
-keepclasseswithmembers class org.jellyfin.apiclient.model.**.* { *; }
|
-keepclasseswithmembers class org.jellyfin.apiclient.model.**.* { *; }
|
||||||
|
|
@ -76,12 +76,6 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.lge.support.SPLIT_WINDOW"
|
android:name="com.lge.support.SPLIT_WINDOW"
|
||||||
android:value="true" />
|
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">
|
<receiver android:name=".widgets.BootReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,19 @@ import androidx.annotation.NonNull;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.GlideBuilder;
|
import com.bumptech.glide.GlideBuilder;
|
||||||
import com.bumptech.glide.Registry;
|
import com.bumptech.glide.Registry;
|
||||||
|
import com.bumptech.glide.annotation.GlideModule;
|
||||||
import com.bumptech.glide.load.DecodeFormat;
|
import com.bumptech.glide.load.DecodeFormat;
|
||||||
import com.bumptech.glide.load.engine.cache.DiskLruCacheFactory;
|
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.bumptech.glide.request.RequestOptions;
|
||||||
import com.dkanada.gramophone.App;
|
|
||||||
import com.dkanada.gramophone.glide.palette.BitmapPaletteTranscoder;
|
import com.dkanada.gramophone.glide.palette.BitmapPaletteTranscoder;
|
||||||
import com.dkanada.gramophone.glide.palette.BitmapPaletteWrapper;
|
import com.dkanada.gramophone.glide.palette.BitmapPaletteWrapper;
|
||||||
import com.dkanada.gramophone.util.PreferenceUtil;
|
import com.dkanada.gramophone.util.PreferenceUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class CustomGlideModule implements GlideModule {
|
@GlideModule
|
||||||
|
public class CustomGlideModule extends AppGlideModule {
|
||||||
@Override
|
@Override
|
||||||
public void applyOptions(@NonNull Context context, GlideBuilder builder) {
|
public void applyOptions(@NonNull Context context, GlideBuilder builder) {
|
||||||
File file = new File(context.getCacheDir() + "glide");
|
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) {
|
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
|
||||||
registry.register(Bitmap.class, BitmapPaletteWrapper.class, new BitmapPaletteTranscoder(glide.getBitmapPool()));
|
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;
|
this.context = context;
|
||||||
|
|
||||||
if (placeholder != null) {
|
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);
|
BitmapDrawable drawable = new BitmapDrawable(context.getResources(), bitmap);
|
||||||
requestManager.applyDefaultRequestOptions(createRequestOptions(item, drawable));
|
requestManager.applyDefaultRequestOptions(createRequestOptions(item, drawable));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue