From e65634cb427eafe9e3bd192f9e8bf71f2243ce6c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 07:27:03 +0000 Subject: [PATCH] Bump coil version and some cleanup Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- app/src/main/java/eu/kanade/tachiyomi/App.kt | 19 +++++++++++++------ gradle/libs.versions.toml | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/App.kt b/app/src/main/java/eu/kanade/tachiyomi/App.kt index 558ad213eb..d0b77cec18 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/App.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/App.kt @@ -153,26 +153,33 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor ) } + @Suppress("MagicNumber") override fun newImageLoader(context: Context): ImageLoader { return ImageLoader.Builder(this).apply { val callFactoryLazy = lazy { Injekt.get().client } components { + // NetworkFetcher.Factory add(OkHttpNetworkFetcherFactory(callFactoryLazy::value)) + // Decoder.Factory add(TachiyomiImageDecoder.Factory()) - add(MangaCoverFetcher.MangaFactory(callFactoryLazy)) + // Fetcher.Factory + add(BufferedSourceFetcher.Factory()) add(MangaCoverFetcher.MangaCoverFactory(callFactoryLazy)) - add(MangaKeyer()) + add(MangaCoverFetcher.MangaFactory(callFactoryLazy)) + // Keyer add(MangaCoverKeyer()) - add(BufferedSourceFetcher.Factory()) + add(MangaKeyer()) } + crossfade((300 * this@App.animatorDurationScale).toInt()) allowRgb565(DeviceUtil.isLowRamDevice(this@App)) if (networkPreferences.verboseLogging().get()) logger(DebugLogger()) // Coil spawns a new thread for every image load by default - fetcherDispatcher(Dispatchers.IO.limitedParallelism(8)) - decoderDispatcher(Dispatchers.IO.limitedParallelism(2)) - }.build() + fetcherCoroutineContext(Dispatchers.IO.limitedParallelism(8)) + decoderCoroutineContext(Dispatchers.IO.limitedParallelism(3)) + } + .build() } override fun onStart(owner: LifecycleOwner) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 84e9797c54..520933e401 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -42,7 +42,7 @@ preferencektx = "androidx.preference:preference-ktx:1.2.1" injekt-core = "com.github.inorichi.injekt:injekt-core:65b0440" -coil-bom = { module = "io.coil-kt.coil3:coil-bom", version = "3.0.0-alpha07" } +coil-bom = { module = "io.coil-kt.coil3:coil-bom", version = "3.0.0-alpha08" } coil-core = { module = "io.coil-kt.coil3:coil" } coil-gif = { module = "io.coil-kt.coil3:coil-gif" } coil-compose = { module = "io.coil-kt.coil3:coil-compose" }