mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
Update imageloader to v1.10.0 (#145)
* Update imageloader to v1.10.0 * Build fixes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
@@ -14,7 +14,7 @@ parcelize = "0.9.0"
|
||||
voyager = "1.1.0-beta03"
|
||||
accompanist = "0.30.1"
|
||||
googleAccompanist = "0.36.0"
|
||||
imageloader = "1.8.1"
|
||||
imageloader = "1.10.0"
|
||||
materialDialogs = "0.9.7"
|
||||
|
||||
# Android
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
package ca.gosyer.jui.ui.base.image
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.ui.graphics.ImageBitmapConfig
|
||||
import ca.gosyer.jui.domain.server.Http
|
||||
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
||||
import com.seiko.imageloader.Bitmap
|
||||
import com.seiko.imageloader.BitmapConfig
|
||||
import com.seiko.imageloader.cache.disk.DiskCacheBuilder
|
||||
import com.seiko.imageloader.cache.memory.MemoryCacheBuilder
|
||||
import com.seiko.imageloader.cache.memory.MemoryKey
|
||||
@@ -21,10 +21,10 @@ import com.seiko.imageloader.option.androidContext
|
||||
import okio.Path.Companion.toOkioPath
|
||||
|
||||
actual fun OptionsBuilder.configure(contextWrapper: ContextWrapper) {
|
||||
bitmapConfig = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
BitmapConfig.ARGB_8888
|
||||
imageBitmapConfig = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
ImageBitmapConfig.Argb8888
|
||||
} else {
|
||||
BitmapConfig.HARDWARE
|
||||
ImageBitmapConfig.Gpu
|
||||
}
|
||||
androidContext(contextWrapper)
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ class ImageLoaderProvider(
|
||||
override fun key(
|
||||
data: Any,
|
||||
options: Options,
|
||||
type: Keyer.Type,
|
||||
): String? {
|
||||
if (data !is Manga) return null
|
||||
return "${data.sourceId}-${data.thumbnailUrl}-${data.thumbnailUrlLastFetched}"
|
||||
@@ -97,7 +96,6 @@ class ImageLoaderProvider(
|
||||
override fun key(
|
||||
data: Any,
|
||||
options: Options,
|
||||
type: Keyer.Type,
|
||||
): String? {
|
||||
if (data !is Extension) return null
|
||||
return data.iconUrl
|
||||
@@ -119,7 +117,6 @@ class ImageLoaderProvider(
|
||||
override fun key(
|
||||
data: Any,
|
||||
options: Options,
|
||||
type: Keyer.Type,
|
||||
): String? {
|
||||
if (data !is Source) return null
|
||||
return data.iconUrl
|
||||
|
||||
@@ -22,8 +22,9 @@ import cafe.adriel.voyager.core.concurrent.AtomicInt32
|
||||
import com.seiko.imageloader.asImageBitmap
|
||||
import com.seiko.imageloader.cache.disk.DiskCache
|
||||
import com.seiko.imageloader.component.decoder.DecodeResult
|
||||
import com.seiko.imageloader.model.DataSource
|
||||
import com.seiko.imageloader.model.ImageResult
|
||||
import com.seiko.imageloader.model.ImageSource
|
||||
import com.seiko.imageloader.model.ImageSourceFrom
|
||||
import com.seiko.imageloader.option.Options
|
||||
import io.ktor.client.plugins.onDownload
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -159,8 +160,8 @@ class TachideskPageLoader(
|
||||
it.source().use { source ->
|
||||
val decoder = bitmapDecoderFactory.create(
|
||||
ImageResult.OfSource(
|
||||
source,
|
||||
DataSource.Engine,
|
||||
ImageSource(source),
|
||||
ImageSourceFrom.Disk,
|
||||
),
|
||||
Options(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user