mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-30 04:57:50 +02:00
Use immutable collections in presentation-widget module
This commit is contained in:
@ -30,6 +30,8 @@ import coil.size.Scale
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.toImmutableList
|
||||
import kotlinx.coroutines.flow.map
|
||||
import tachiyomi.core.util.lang.withIOContext
|
||||
import tachiyomi.domain.manga.model.MangaCover
|
||||
@ -106,7 +108,7 @@ abstract class BaseUpdatesGridGlanceWidget(
|
||||
private suspend fun List<UpdatesWithRelations>.prepareData(
|
||||
rowCount: Int,
|
||||
columnCount: Int,
|
||||
): List<Pair<Long, Bitmap?>> {
|
||||
): ImmutableList<Pair<Long, Bitmap?>> {
|
||||
// Resize to cover size
|
||||
val widthPx = CoverWidth.value.toInt().dpToPx
|
||||
val heightPx = CoverHeight.value.toInt().dpToPx
|
||||
@ -140,6 +142,7 @@ abstract class BaseUpdatesGridGlanceWidget(
|
||||
.build()
|
||||
Pair(updatesView.mangaId, context.imageLoader.executeBlocking(request).drawable?.toBitmap())
|
||||
}
|
||||
.toImmutableList()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user