mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-22 21:02:16 +03:00
Bump coil version and some cleanup
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
parent
20d8b06104
commit
633e9880a2
2 changed files with 13 additions and 6 deletions
|
@ -174,30 +174,37 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
|
|||
)
|
||||
}
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
override fun newImageLoader(context: Context): ImageLoader {
|
||||
return ImageLoader.Builder(this).apply {
|
||||
val callFactoryLazy = lazy { Injekt.get<NetworkHelper>().client }
|
||||
components {
|
||||
// NetworkFetcher.Factory
|
||||
add(OkHttpNetworkFetcherFactory(callFactoryLazy::value))
|
||||
// Decoder.Factory
|
||||
add(TachiyomiImageDecoder.Factory())
|
||||
// Fetcher.Factory
|
||||
add(BufferedSourceFetcher.Factory())
|
||||
add(MangaCoverFetcher.MangaFactory(callFactoryLazy))
|
||||
add(MangaCoverFetcher.MangaCoverFactory(callFactoryLazy))
|
||||
add(AnimeCoverFetcher.AnimeFactory(callFactoryLazy))
|
||||
add(AnimeCoverFetcher.AnimeCoverFactory(callFactoryLazy))
|
||||
// Keyer
|
||||
add(AnimeKeyer())
|
||||
add(MangaCoverFetcher.MangaCoverFactory(callFactoryLazy))
|
||||
add(MangaKeyer())
|
||||
add(AnimeCoverKeyer())
|
||||
add(MangaCoverKeyer())
|
||||
add(BufferedSourceFetcher.Factory())
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Reference in a new issue