commit 00b6f25933373c5a4a2d093641763a8caa61ea5f
parent 6eb5ead35d322eacde869a02a964dd7842056088
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Sun, 6 Aug 2023 16:42:37 +0200
fix(ui/downloads): image preview
- fix blur
- add crossfade
Diffstat:
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/sections/downloads/DownloadsSection.kt
@@ -52,6 +52,7 @@ import coil.compose.rememberAsyncImagePainter
import coil.decode.VideoFrameDecoder
import coil.memory.MemoryCache
import coil.request.ImageRequest
+import coil.size.Precision
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import me.rhunk.snapenhance.R
@@ -150,25 +151,26 @@ class DownloadsSection : Section() {
.fillMaxWidth()
.clip(MaterialTheme.shapes.medium)
) {
- Box(modifier = Modifier.height(120.dp)) {
+ Box(modifier = Modifier.height(100.dp)) {
Image(
painter = rememberAsyncImagePainter(
model = ImageRequest.Builder(context.androidContext)
.data(download.outputFile)
.memoryCacheKey(download.outputFile)
+ .crossfade(true)
.build(),
imageLoader = imageLoader
),
modifier = Modifier
.matchParentSize()
- .blur(5.dp),
+ .blur(12.dp),
contentDescription = null,
contentScale = ContentScale.FillWidth
)
Row(
modifier = Modifier
- .padding(start = 16.dp, end = 16.dp)
+ .padding(start = 10.dp, end = 10.dp)
.fillMaxWidth()
.fillMaxHeight(),
verticalAlignment = Alignment.CenterVertically
@@ -188,6 +190,8 @@ class DownloadsSection : Section() {
model = ImageRequest.Builder(context.androidContext)
.data(download.metadata.iconUrl)
.fallback(R.drawable.bitmoji_blank)
+ .precision(Precision.INEXACT)
+ .crossfade(true)
.memoryCacheKey(download.metadata.iconUrl)
.build(),
imageLoader = imageLoader