Update glide

okjack
FongMi 2 years ago
parent 724d1c4c7b
commit b0a69fd742
  1. 8
      app/build.gradle
  2. 5
      app/src/main/java/com/fongmi/android/tv/utils/ImgUtil.java

@ -107,9 +107,9 @@ dependencies {
implementation 'androidx.media:media:1.6.0'
implementation 'cat.ereza:customactivityoncrash:2.4.0'
implementation 'com.github.bassaer:materialdesigncolors:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.15.1'
implementation 'com.github.bumptech.glide:annotations:4.15.1'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.15.1'
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation 'com.github.bumptech.glide:annotations:4.16.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'
implementation 'com.github.jahirfiquitiva:TextDrawable:1.0.3'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:289db1178ab66694c23893e6a487d4708343c47b'
implementation('com.github.thegrizzlylabs:sardine-android:0.8') { exclude group: 'com.squareup.okhttp3', module: 'okhttp' }
@ -139,5 +139,5 @@ dependencies {
//mobileImplementation 'com.google.android.gms:play-services-cast-framework:21.3.0'
mobileImplementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
annotationProcessor 'androidx.room:room-compiler:2.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
}

@ -9,6 +9,7 @@ import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
@ -124,14 +125,14 @@ public class ImgUtil {
private static RequestListener<Bitmap> getListener(ImageView view, ImageView.ScaleType scaleType) {
return new RequestListener<>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
public boolean onLoadFailed(@Nullable GlideException e, Object model, @NonNull Target<Bitmap> target, boolean isFirstResource) {
view.setScaleType(scaleType);
view.setImageResource(R.drawable.ic_img_error);
return true;
}
@Override
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
public boolean onResourceReady(@NonNull Bitmap resource, @NonNull Object model, Target<Bitmap> target, @NonNull DataSource dataSource, boolean isFirstResource) {
view.setScaleType(ImageView.ScaleType.CENTER_CROP);
return false;
}

Loading…
Cancel
Save