File tree Expand file tree Collapse file tree
utils/src/main/java/com/haoge/easyandroid/easy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ dependencies {
3434
3535 implementation " com.jakewharton:butterknife:$butterknife_version "
3636 kapt " com.jakewharton:butterknife-compiler:$butterknife_version "
37- implementation ' com.github.bumptech.glide:glide:4.5 .0'
37+ implementation ' com.github.bumptech.glide:glide:4.8 .0'
3838 annotationProcessor ' com.github.bumptech.glide:compiler:4.5.0'
3939
4040
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable
2222import android.os.AsyncTask
2323import android.os.Build
2424import android.text.Html
25+ import android.util.Log
2526import android.widget.TextView
2627import com.bumptech.glide.Glide
2728import com.haoge.easyandroid.EasyAndroid
@@ -111,14 +112,19 @@ class EasyImageGetter:Html.ImageGetter {
111112
112113 val url = params[0 ]? : throw RuntimeException (" URL is null" )
113114 // 先使用用户设置的loader进行加载
114- val result = loader?.invoke(url)
115- if (result != null ) return result
115+ try {
116+ val result = loader?.invoke(url)
117+ if (result != null ) return result
118+ } catch (e: Exception ) {
119+ Log .e(" EasyImageGetter" , " A error occurs with loader:[${loader?.javaClass?.canonicalName} ]" , e)
120+ }
121+
116122 // 当用户设置的loader加载失败时(返回null), 则使用内部机制进行drawable获取
117123 if (glideSupport.not ()) throw RuntimeException (" Internal loader requires glide to load drawable!" )
118124 val context = container.get()?.context? : throw RuntimeException (" Fetch context failed from container" )
119125 return Glide .with (context).load(url).submit().get()
120126 } catch (e: Exception ) {
121- e.printStackTrace( )
127+ Log .e( " EasyImageGetter " , " A error occurs with internal loader " , e )
122128 return null
123129 }
124130 }
You can’t perform that action at this time.
0 commit comments