diff --git a/core/src/main/java/io/plaidapp/core/util/glide/ImageSpanTarget.kt b/core/src/main/java/io/plaidapp/core/util/glide/ImageSpanTarget.kt index dde3c2691..f25a1d401 100644 --- a/core/src/main/java/io/plaidapp/core/util/glide/ImageSpanTarget.kt +++ b/core/src/main/java/io/plaidapp/core/util/glide/ImageSpanTarget.kt @@ -19,13 +19,14 @@ package io.plaidapp.core.util.glide import `in`.uncod.android.bypass.style.ImageLoadingSpan import android.graphics.Bitmap import android.graphics.drawable.BitmapDrawable +import android.graphics.drawable.Drawable import android.text.SpannableStringBuilder import android.text.Spanned import android.text.style.ImageSpan import android.transition.TransitionManager import android.view.ViewGroup import android.widget.TextView -import com.bumptech.glide.request.target.SimpleTarget +import com.bumptech.glide.request.target.CustomViewTarget import com.bumptech.glide.request.transition.Transition import java.lang.ref.WeakReference @@ -36,8 +37,7 @@ import java.lang.ref.WeakReference class ImageSpanTarget( textView: TextView, private val loadingSpan: ImageLoadingSpan -) : SimpleTarget() { - +) : CustomViewTarget(textView) { private val textView: WeakReference = WeakReference(textView) override fun onResourceReady(bitmap: Bitmap, transition: Transition?) { @@ -66,4 +66,12 @@ class ImageSpanTarget( } } } + + override fun onLoadFailed(errorDrawable: Drawable?) { + // I don't think it is useful to set compound drawable to error drawable + } + + override fun onResourceCleared(placeholder: Drawable?) { + // I don't think it is useful to set compound drawable to placeholder drawable + } }