Skip to content
Snippets Groups Projects
Commit 47ca6c76 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Image loading: Use Activity scope if available

parent 055078a6
No related branches found
No related tags found
No related merge requests found
Pipeline #8694 passed with stage
in 4 minutes and 12 seconds
......@@ -78,7 +78,10 @@ fun loadImage(v: View, item: MediaLibraryItem?, imageWidth: Int = 0) {
}
val bitmap = if (cacheKey !== null) BitmapCache.getBitmapFromMemCache(cacheKey) else null
if (bitmap !== null) updateImageView(bitmap, v, binding)
else AppScope.launch { getImage(v, findInLibrary(item, isMedia, isGroup), binding, imageWidth) }
else {
val scope = (v.context as? CoroutineScope) ?: AppScope
scope.launch { getImage(v, findInLibrary(item, isMedia, isGroup), binding, imageWidth) }
}
}
fun loadPlaylistImageWithWidth(v: ImageView, item: MediaLibraryItem?, imageWidth: Int) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment