You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}
class GlideImageLoader(private val context: Context) : ImageLoader {
// TODO Consider using Target for image loading
override suspend fun loadImage(url: String, callback: (Drawable) -> Unit) {
try {
callback(withContext(Dispatchers.IO) {
Glide.with(context)
//.clearOnStop()
.load(url)
.placeholder(android.R.drawable.stat_sys_download)
.error(android.R.drawable.stat_notify_error)
//.fallback(android.R.drawable.stat_notify_sync)
.submit()
.get()
})
} catch (e: Exception) { // TODO Memory leak here, resources not released on 404
when (e) {
is IOException, is CancellationException, is ExecutionException -> {
throw ImageLoadingException("Error loading image using Glide", e)
The text was updated successfully, but these errors were encountered:
DogTok/app/src/main/java/com/freezerain/dogtok/util/ImageLoader.kt
Line 33 in 8d8e63e
The text was updated successfully, but these errors were encountered: