Merge pull request #5930 from TacoTheDank/bumpGlide

Update Glide library
This commit is contained in:
ByteHamster 2022-06-09 22:55:39 +02:00 committed by GitHub
commit 992ca915a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 22 deletions

View File

@ -52,15 +52,6 @@
# android-iconify
-keep class com.joanzapata.** { *; }
# Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder
#### Proguard rules for fyyd client
# Retrofit 2.0
-dontwarn retrofit2.**

View File

@ -118,7 +118,7 @@ public class SelectSubscriptionActivity extends AppCompatActivity {
Glide.with(this)
.asBitmap()
.load(feed.getImageUrl())
.apply(new RequestOptions().override(iconSize, iconSize))
.apply(RequestOptions.overrideOf(iconSize, iconSize))
.listener(new RequestListener<Bitmap>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model,

View File

@ -108,7 +108,7 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte
.apply(new RequestOptions()
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.dontAnimate()
.transforms(new FitCenter(), new RoundedCorners((int)
.transform(new FitCenter(), new RoundedCorners((int)
(4 * context.getResources().getDisplayMetrics().density))))
.into(holder.image);
}

View File

@ -85,7 +85,7 @@ public class ItunesAdapter extends ArrayAdapter<PodcastSearchResult> {
.apply(new RequestOptions()
.placeholder(R.color.light_gray)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.transforms(new FitCenter(),
.transform(new FitCenter(),
new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density)))
.dontAnimate())
.into(viewHolder.coverView);

View File

@ -310,7 +310,7 @@ public class CoverFragment extends Fragment {
RequestOptions options = new RequestOptions()
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.dontAnimate()
.transforms(new FitCenter(),
.transform(new FitCenter(),
new RoundedCorners((int) (16 * getResources().getDisplayMetrics().density)));
RequestBuilder<Drawable> cover = Glide.with(this)

View File

@ -293,7 +293,7 @@ public class ItemFragment extends Fragment {
RequestOptions options = new RequestOptions()
.error(R.color.light_gray)
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.transforms(new FitCenter(),
.transform(new FitCenter(),
new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density)))
.dontAnimate();

View File

@ -52,7 +52,7 @@ project.ext {
commonslangVersion = "3.6"
commonsioVersion = "2.5"
jsoupVersion = "1.15.1"
glideVersion = "4.8.0"
glideVersion = "4.13.2"
okhttpVersion = "3.12.10"
okioVersion = "1.17.5"
eventbusVersion = "3.2.0"

View File

@ -31,7 +31,7 @@ public class ApGlideModule extends AppGlideModule {
@Override
public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) {
builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_ARGB_8888));
builder.setDefaultRequestOptions(RequestOptions.formatOf(DecodeFormat.PREFER_ARGB_8888));
@SuppressLint("UsableSpace")
long spaceAvailable = context.getCacheDir().getUsableSpace();
long imageCacheSize = (spaceAvailable > 2 * GIGABYTES) ? (250 * MEGABYTES) : (50 * MEGABYTES);

View File

@ -119,8 +119,9 @@ public class NewEpisodesNotification {
return Glide.with(context)
.asBitmap()
.load(feed.getImageUrl())
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.apply(new RequestOptions().centerCrop())
.apply(new RequestOptions()
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.centerCrop())
.submit(iconSize, iconSize)
.get();
} catch (Throwable tr) {

View File

@ -72,12 +72,14 @@ public class PlaybackServiceNotificationBuilder {
public void loadIcon() {
int iconSize = (int) (128 * context.getResources().getDisplayMetrics().density);
final RequestOptions options = new RequestOptions()
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.centerCrop();
try {
icon = Glide.with(context)
.asBitmap()
.load(playable.getImageLocation())
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.apply(new RequestOptions().centerCrop())
.apply(options)
.submit(iconSize, iconSize)
.get();
} catch (ExecutionException e) {
@ -85,8 +87,7 @@ public class PlaybackServiceNotificationBuilder {
icon = Glide.with(context)
.asBitmap()
.load(ImageResourceUtils.getFallbackImageLocation(playable))
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
.apply(new RequestOptions().centerCrop())
.apply(options)
.submit(iconSize, iconSize)
.get();
} catch (InterruptedException ignore) {