|
|
|
|
@ -16,7 +16,6 @@ import androidx.annotation.Nullable; |
|
|
|
|
import com.bumptech.glide.Glide; |
|
|
|
|
import com.bumptech.glide.RequestBuilder; |
|
|
|
|
import com.bumptech.glide.load.DataSource; |
|
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy; |
|
|
|
|
import com.bumptech.glide.load.engine.GlideException; |
|
|
|
|
import com.bumptech.glide.load.model.GlideUrl; |
|
|
|
|
import com.bumptech.glide.load.model.LazyHeaders; |
|
|
|
|
@ -72,7 +71,7 @@ public class ImgUtil { |
|
|
|
|
if (!vod) view.setVisibility(TextUtils.isEmpty(url) ? View.GONE : View.VISIBLE); |
|
|
|
|
if (TextUtils.isEmpty(url) || failed.contains(url)) view.setImageDrawable(getTextDrawable(text, vod)); |
|
|
|
|
else try { |
|
|
|
|
RequestBuilder<Drawable> builder = Glide.with(view).load(getUrl(url)).diskCacheStrategy(DiskCacheStrategy.RESOURCE).listener(getListener(text, url, view, vod)); |
|
|
|
|
RequestBuilder<Drawable> builder = Glide.with(view).load(getUrl(url)).listener(getListener(text, url, view, vod)); |
|
|
|
|
if (vod) builder.centerCrop().into(view); |
|
|
|
|
else builder.fitCenter().into(view); |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
|