|
|
|
|
@ -17,7 +17,6 @@ import org.koitharu.kotatsu.core.prefs.AppWidgetConfig
|
|
|
|
|
import org.koitharu.kotatsu.favourites.domain.FavouritesRepository
|
|
|
|
|
import org.koitharu.kotatsu.parsers.model.Manga
|
|
|
|
|
import org.koitharu.kotatsu.utils.ext.requireBitmap
|
|
|
|
|
import java.io.IOException
|
|
|
|
|
|
|
|
|
|
class ShelfListFactory(
|
|
|
|
|
private val context: Context,
|
|
|
|
|
@ -61,8 +60,8 @@ class ShelfListFactory(
|
|
|
|
|
val views = RemoteViews(context.packageName, R.layout.item_shelf)
|
|
|
|
|
val item = dataSet[position]
|
|
|
|
|
views.setTextViewText(R.id.textView_title, item.title)
|
|
|
|
|
try {
|
|
|
|
|
val cover = coil.executeBlocking(
|
|
|
|
|
runCatching {
|
|
|
|
|
coil.executeBlocking(
|
|
|
|
|
ImageRequest.Builder(context)
|
|
|
|
|
.data(item.coverUrl)
|
|
|
|
|
.size(coverSize)
|
|
|
|
|
@ -70,8 +69,9 @@ class ShelfListFactory(
|
|
|
|
|
.transformations(transformation)
|
|
|
|
|
.build()
|
|
|
|
|
).requireBitmap()
|
|
|
|
|
}.onSuccess { cover ->
|
|
|
|
|
views.setImageViewBitmap(R.id.imageView_cover, cover)
|
|
|
|
|
} catch (e: IOException) {
|
|
|
|
|
}.onFailure {
|
|
|
|
|
views.setImageViewResource(R.id.imageView_cover, R.drawable.ic_placeholder)
|
|
|
|
|
}
|
|
|
|
|
val intent = Intent()
|
|
|
|
|
|