diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 80799c1ce7..ef8c2e8cd5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -197,10 +197,10 @@ dependencies { implementation("com.github.inorichi.injekt:injekt-core:65b0440") // Image library - val coilVersion = "0.10.1" - implementation("io.coil-kt:coil:${Versions.COIL}") - implementation("io.coil-kt:coil-gif:${Versions.COIL}") - implementation("io.coil-kt:coil-svg:${Versions.COIL}") + val coilVersion = "1.2.1" + implementation("io.coil-kt:coil:$coilVersion") + implementation("io.coil-kt:coil-gif:$coilVersion") + implementation("io.coil-kt:coil-svg:$coilVersion") // Logging implementation("com.jakewharton.timber:timber:${Versions.TIMBER}") diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt index c8ee21440d..06152edf0a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt @@ -2,7 +2,8 @@ package eu.kanade.tachiyomi.data.cache import android.content.Context import android.text.format.Formatter -import coil.Coil +import coil.imageLoader +import coil.memory.MemoryCache import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.Manga @@ -174,7 +175,7 @@ class CoverCache(val context: Context) { fun setCustomCoverToCache(manga: Manga, inputStream: InputStream) { getCustomCoverFile(manga).outputStream().use { inputStream.copyTo(it) - Coil.imageLoader(context).invalidate(manga.key()) + context.imageLoader.memoryCache.remove(MemoryCache.Key(manga.key())) } } @@ -188,7 +189,7 @@ class CoverCache(val context: Context) { val result = getCustomCoverFile(manga).let { it.exists() && it.delete() } - Coil.imageLoader(context).invalidate(manga.key()) + context.imageLoader.memoryCache.remove(MemoryCache.Key(manga.key())) return result } @@ -213,7 +214,7 @@ class CoverCache(val context: Context) { fun deleteFromCache(name: String?) { if (name.isNullOrEmpty()) return val file = getCoverFile(MangaImpl().apply { thumbnail_url = name }) - Coil.imageLoader(context).invalidate(file.name) + context.imageLoader.memoryCache.remove(MemoryCache.Key(file.name)) if (file.exists()) file.delete() } @@ -234,7 +235,7 @@ class CoverCache(val context: Context) { val file = getCoverFile(manga) if (deleteCustom) deleteCustomCover(manga) if (file.exists()) { - Coil.imageLoader(context).invalidate(file.name) + context.imageLoader.memoryCache.remove(MemoryCache.Key(file.name)) file.delete() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/ByteArrayFetcher.kt b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/ByteArrayFetcher.kt index b30de27c47..b6beb02d0b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/ByteArrayFetcher.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/ByteArrayFetcher.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.data.image.coil -import coil.bitmappool.BitmapPool +import coil.bitmap.BitmapPool import coil.decode.DataSource import coil.decode.Options import coil.fetch.FetchResult diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/LibraryMangaImageTarget.kt b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/LibraryMangaImageTarget.kt index e364546acb..fe9fa56949 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/LibraryMangaImageTarget.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/LibraryMangaImageTarget.kt @@ -5,9 +5,10 @@ import android.graphics.drawable.Drawable import android.widget.ImageView import coil.Coil import coil.ImageLoader -import coil.request.LoadRequest -import coil.request.LoadRequestBuilder -import coil.request.RequestDisposable +import coil.imageLoader +import coil.memory.MemoryCache +import coil.request.Disposable +import coil.request.ImageRequest import coil.target.ImageViewTarget import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.database.models.Manga @@ -30,7 +31,7 @@ class LibraryMangaImageTarget( BitmapFactory.decodeFile(file.path, options) if (options.outWidth == -1 || options.outHeight == -1) { file.delete() - Coil.imageLoader(view.context).invalidate(manga.key()) + view.context.imageLoader.memoryCache.remove(MemoryCache.Key(manga.key())) } } } @@ -40,12 +41,12 @@ class LibraryMangaImageTarget( inline fun ImageView.loadLibraryManga( manga: Manga, imageLoader: ImageLoader = Coil.imageLoader(context), - builder: LoadRequestBuilder.() -> Unit = {} -): RequestDisposable { - val request = LoadRequest.Builder(context) + builder: ImageRequest.Builder.() -> Unit = {} +): Disposable { + val request = ImageRequest.Builder(context) .data(manga) .target(LibraryMangaImageTarget(this, manga)) .apply(builder) .build() - return imageLoader.execute(request) + return imageLoader.enqueue(request) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/MangaFetcher.kt b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/MangaFetcher.kt index 964bc5757a..0c18ecf427 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/MangaFetcher.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/image/coil/MangaFetcher.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.data.image.coil import android.webkit.MimeTypeMap -import coil.bitmappool.BitmapPool +import coil.bitmap.BitmapPool import coil.decode.DataSource import coil.decode.Options import coil.fetch.FetchResult diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt index 3c2c132158..ec1982f976 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateNotifier.kt @@ -12,7 +12,7 @@ import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import coil.Coil import coil.request.CachePolicy -import coil.request.GetRequest +import coil.request.ImageRequest import coil.request.Parameters import coil.transform.CircleCropTransformation import eu.kanade.tachiyomi.R @@ -138,7 +138,7 @@ class LibraryUpdateNotifier(private val context: Context) { context.notification(Notifications.CHANNEL_NEW_CHAPTERS) { setSmallIcon(R.drawable.ic_tachi) try { - val request = GetRequest.Builder(context).data(manga) + val request = ImageRequest.Builder(context).data(manga) .parameters(Parameters.Builder().set(MangaFetcher.onlyCache, true).build()) .networkCachePolicy(CachePolicy.READ_ONLY) .transformations(CircleCropTransformation()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt index 946e79db9a..52074b97c1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateService.kt @@ -8,7 +8,7 @@ import android.os.IBinder import android.os.PowerManager import coil.Coil import coil.request.CachePolicy -import coil.request.LoadRequest +import coil.request.ImageRequest import coil.request.Parameters import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.database.DatabaseHelper @@ -453,12 +453,12 @@ class LibraryUpdateService( coverCache.deleteFromCache(thumbnailUrl) // load new covers in background val request = - LoadRequest.Builder(this@LibraryUpdateService).data(manga) + ImageRequest.Builder(this@LibraryUpdateService).data(manga) .memoryCachePolicy(CachePolicy.DISABLED).build() Coil.imageLoader(this@LibraryUpdateService).execute(request) } else { val request = - LoadRequest.Builder(this@LibraryUpdateService).data(manga) + ImageRequest.Builder(this@LibraryUpdateService).data(manga) .memoryCachePolicy(CachePolicy.DISABLED) .parameters(Parameters.Builder().set(MangaFetcher.onlyFetchRemotely, true).build()) .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt index 5ced557e53..a81a1fe74e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionHolder.kt @@ -4,8 +4,8 @@ import android.content.res.ColorStateList import android.graphics.Color import android.view.View import androidx.core.content.ContextCompat -import coil.api.clear -import coil.api.load +import coil.clear +import coil.load import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.InstallStep diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt index 82617d8d81..4ae573a94c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryGridHolder.kt @@ -5,7 +5,7 @@ import android.view.Gravity import android.view.View import android.widget.FrameLayout import androidx.core.view.isVisible -import coil.api.clear +import coil.clear import coil.size.Precision import coil.size.Scale import eu.kanade.tachiyomi.data.database.models.Manga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt index 0a9897df0f..9dfdecdf8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListHolder.kt @@ -3,7 +3,7 @@ package eu.kanade.tachiyomi.ui.library import android.view.View import android.view.ViewGroup import androidx.core.view.isVisible -import coil.api.clear +import coil.clear import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.image.coil.loadLibraryManga import eu.kanade.tachiyomi.databinding.MangaListItemBinding diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/EditMangaDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/EditMangaDialog.kt index 4561412fcb..8e8ca16b1b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/EditMangaDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/EditMangaDialog.kt @@ -4,7 +4,7 @@ import android.app.Dialog import android.net.Uri import android.os.Bundle import androidx.core.view.isVisible -import coil.api.loadAny +import coil.loadAny import coil.request.Parameters import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.customview.customView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index ccdd5c2f1b..ec5927294f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -41,7 +41,8 @@ import androidx.transition.ChangeImageTransform import androidx.transition.TransitionManager import androidx.transition.TransitionSet import coil.Coil -import coil.request.LoadRequest +import coil.imageLoader +import coil.request.ImageRequest import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.checkbox.checkBoxPrompt import com.afollestad.materialdialogs.checkbox.isCheckPromptChecked @@ -325,7 +326,7 @@ class MangaDetailsController : fun setPaletteColor() { val view = view ?: return - val request = LoadRequest.Builder(view.context).data(presenter.manga).allowHardware(false) + val request = ImageRequest.Builder(view.context).data(presenter.manga).allowHardware(false) .target( onSuccess = { drawable -> val bitmap = (drawable as BitmapDrawable).bitmap @@ -358,7 +359,7 @@ class MangaDetailsController : } } ).build() - Coil.imageLoader(view.context).execute(request) + view.context.imageLoader.enqueue(request) } /** Set toolbar theme for themes that are inverted (ie. light blue theme) */ @@ -856,7 +857,7 @@ class MangaDetailsController : override fun prepareToShareManga() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - val request = LoadRequest.Builder(activity!!).data(manga).target( + val request = ImageRequest.Builder(activity!!).data(manga).target( onError = { shareManga() }, @@ -864,7 +865,7 @@ class MangaDetailsController : presenter.shareManga((it as BitmapDrawable).bitmap) } ).build() - Coil.imageLoader(activity!!).execute(request) + Coil.imageLoader(activity!!).enqueue(request) } else { shareManga() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt index 0bac9a588e..ea6bbcbcce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsPresenter.kt @@ -6,7 +6,7 @@ import android.net.Uri import android.os.Environment import coil.Coil import coil.request.CachePolicy -import coil.request.GetRequest +import coil.request.ImageRequest import coil.request.Parameters import coil.request.SuccessResult import eu.kanade.tachiyomi.R @@ -354,7 +354,7 @@ class MangaDetailsPresenter( launchIO { val request = - GetRequest.Builder(preferences.context).data(manga) + ImageRequest.Builder(preferences.context).data(manga) .memoryCachePolicy(CachePolicy.DISABLED) .parameters( Parameters.Builder().set(MangaFetcher.onlyFetchRemotely, true) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index 9e49759699..5ca32aeb82 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -10,11 +10,13 @@ import androidx.core.content.ContextCompat import androidx.core.graphics.ColorUtils import androidx.core.view.isInvisible import androidx.core.view.isVisible -import coil.api.loadAny +import coil.loadAny import coil.request.CachePolicy +import coil.request.Parameters import com.google.android.material.button.MaterialButton import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Manga +import eu.kanade.tachiyomi.data.image.coil.MangaFetcher import eu.kanade.tachiyomi.databinding.MangaHeaderItemBinding import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.model.SManga diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt index ac9747de72..7b6ede0f76 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchAdapter.kt @@ -5,8 +5,8 @@ import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter import androidx.core.view.isVisible -import coil.api.clear -import coil.api.load +import coil.clear +import coil.load import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.track.model.TrackSearch import eu.kanade.tachiyomi.databinding.TrackSearchItemBinding diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt index b90e069647..60813b862c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/MangaHolder.kt @@ -2,8 +2,8 @@ package eu.kanade.tachiyomi.ui.migration import android.view.View import androidx.recyclerview.widget.RecyclerView -import coil.api.clear -import coil.api.loadAny +import coil.clear +import coil.loadAny import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.databinding.MangaListItemBinding diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt index 53dacf8cfb..c4de205f61 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/migration/manga/process/MigrationProcessHolder.kt @@ -6,7 +6,7 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.view.isInvisible import androidx.core.view.isVisible import coil.Coil -import coil.request.LoadRequest +import coil.request.ImageRequest import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.DatabaseHelper import eu.kanade.tachiyomi.data.database.models.Manga @@ -136,9 +136,9 @@ class MigrationProcessHolder( (root.layoutParams as ConstraintLayout.LayoutParams).verticalBias = 1f progress.isVisible = false - val request = LoadRequest.Builder(view.context).data(manga) + val request = ImageRequest.Builder(view.context).data(manga) .target(CoverViewTarget(coverThumbnail, progress)).build() - Coil.imageLoader(view.context).execute(request) + Coil.imageLoader(view.context).enqueue(request) compactTitle.isVisible = true gradient.isVisible = true diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt index b1bbc0ca94..cf609f52b5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/SaveImageNotifier.kt @@ -7,7 +7,7 @@ import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat import coil.Coil import coil.request.CachePolicy -import coil.request.LoadRequest +import coil.request.ImageRequest import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationHandler import eu.kanade.tachiyomi.data.notification.NotificationReceiver @@ -38,7 +38,7 @@ class SaveImageNotifier(private val context: Context) { * @param file image file containing downloaded page image. */ fun onComplete(file: File) { - val request = LoadRequest.Builder(context).memoryCachePolicy(CachePolicy.DISABLED).diskCachePolicy(CachePolicy.DISABLED) + val request = ImageRequest.Builder(context).memoryCachePolicy(CachePolicy.DISABLED).diskCachePolicy(CachePolicy.DISABLED) .data(file) .size(720, 1280) .target( @@ -51,7 +51,7 @@ class SaveImageNotifier(private val context: Context) { } } ).build() - Coil.imageLoader(context).execute(request) + Coil.imageLoader(context).enqueue(request) } private fun showCompleteNotification(file: File, image: Bitmap) { @@ -63,9 +63,7 @@ class SaveImageNotifier(private val context: Context) { setAutoCancel(true) color = ContextCompat.getColor(context, R.color.colorAccent) // Clear old actions if they exist - if (mActions.isNotEmpty()) { - mActions.clear() - } + clearActions() setContentIntent(NotificationHandler.openImagePendingActivity(context, file)) // Share action diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt index fd09d9d2ef..a050022b60 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerPageHolder.kt @@ -21,7 +21,7 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.core.net.toUri import androidx.core.view.isVisible -import coil.api.loadAny +import coil.loadAny import coil.request.CachePolicy import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index 46d307c197..55aa834e52 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -16,8 +16,8 @@ import androidx.appcompat.widget.AppCompatButton import androidx.appcompat.widget.AppCompatImageView import androidx.core.net.toUri import androidx.core.view.isVisible -import coil.api.clear -import coil.api.loadAny +import coil.clear +import coil.loadAny import coil.request.CachePolicy import com.davemorrissey.labs.subscaleview.ImageSource import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceGridHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceGridHolder.kt index c01c39feb5..314f96c4a5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceGridHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceGridHolder.kt @@ -5,8 +5,9 @@ import android.view.View import androidx.core.view.isVisible import androidx.recyclerview.widget.RecyclerView import coil.Coil -import coil.api.clear -import coil.request.LoadRequest +import coil.clear +import coil.imageLoader +import coil.request.ImageRequest import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.data.database.models.Manga @@ -60,10 +61,10 @@ class BrowseSourceGridHolder( if (manga.thumbnail_url == null) { binding.coverThumbnail.clear() } else { - val id = manga.id ?: return - val request = LoadRequest.Builder(view.context).data(manga) + manga.id ?: return + val request = ImageRequest.Builder(view.context).data(manga) .target(CoverViewTarget(binding.coverThumbnail, binding.progress)).build() - Coil.imageLoader(view.context).execute(request) + Coil.imageLoader(view.context).enqueue(request) } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt index 543d596a42..5dceb8343e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/source/browse/BrowseSourceListHolder.kt @@ -3,8 +3,8 @@ package eu.kanade.tachiyomi.ui.source.browse import android.view.View import androidx.recyclerview.widget.RecyclerView import coil.Coil -import coil.api.clear -import coil.request.LoadRequest +import coil.clear +import coil.request.ImageRequest import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R @@ -49,9 +49,9 @@ class BrowseSourceListHolder(private val view: View, adapter: FlexibleAdapter when (item) { is Manga -> { - val request = GetRequest.Builder(context).data(item).build() + val request = ImageRequest.Builder(context).data(item).build() val bitmap = ( Coil.imageLoader(context) .execute(request).drawable as? BitmapDrawable