From 05403dbb2132dd58dc710af380c699322b5880eb Mon Sep 17 00:00:00 2001 From: SangEun Date: Fri, 29 Dec 2023 13:25:14 +0900 Subject: [PATCH] =?UTF-8?q?=ED=99=88=ED=99=94=EB=A9=B4=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EB=94=94=EC=9E=90?= =?UTF-8?q?=EC=9D=B8=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/model/mapper/FormattedTimeMapper.kt | 2 +- .../contents/component/MyChecklistItem.kt | 88 ++++++++++--------- 2 files changed, 46 insertions(+), 44 deletions(-) diff --git a/data/src/main/java/com/dkin/chevit/data/model/mapper/FormattedTimeMapper.kt b/data/src/main/java/com/dkin/chevit/data/model/mapper/FormattedTimeMapper.kt index b21178e..2bacf33 100644 --- a/data/src/main/java/com/dkin/chevit/data/model/mapper/FormattedTimeMapper.kt +++ b/data/src/main/java/com/dkin/chevit/data/model/mapper/FormattedTimeMapper.kt @@ -21,7 +21,7 @@ internal object FormattedTimeMapper { fun mapLocalDate(unixMillis: Long): LocalDateTime? { return LocalDateTime.ofInstant( - Instant.ofEpochMilli(unixMillis), + Instant.ofEpochMilli(unixMillis * 1000), TimeZone.getDefault().toZoneId() ) } diff --git a/presentation/home/src/main/java/com/dkin/chevit/presentation/home/contents/component/MyChecklistItem.kt b/presentation/home/src/main/java/com/dkin/chevit/presentation/home/contents/component/MyChecklistItem.kt index 4fa0a37..8ce873a 100644 --- a/presentation/home/src/main/java/com/dkin/chevit/presentation/home/contents/component/MyChecklistItem.kt +++ b/presentation/home/src/main/java/com/dkin/chevit/presentation/home/contents/component/MyChecklistItem.kt @@ -3,13 +3,13 @@ package com.dkin.chevit.presentation.home.contents.component import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.border -import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape @@ -23,7 +23,6 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import coil.compose.AsyncImage import coil.request.ImageRequest -import com.dkin.chevit.presentation.home.HomeState import com.dkin.chevit.presentation.home.model.CheckListItem import com.dkin.chevit.presentation.resource.ChevitTheme @@ -35,59 +34,61 @@ fun MyChecklistItem( onLongClickItem: (id: String, title: String) -> Unit, modifier: Modifier = Modifier, ) { - Box { + Box( + modifier = Modifier + .fillMaxWidth() + .height(90.dp) + .clip(RoundedCornerShape(12.dp)) + .combinedClickable( + onClick = { onClickItem(item.id) }, + onLongClick = { onLongClickItem(item.id, item.title) } + ), + contentAlignment = Alignment.Center + ) { AsyncImage( - modifier = Modifier - .fillMaxSize() - .clip(RoundedCornerShape(12.dp)), + modifier = Modifier.fillMaxSize(), model = ImageRequest.Builder(LocalContext.current) .data(item.backgroundUrl) .crossfade(true) .build(), contentDescription = "", - contentScale = ContentScale.FillHeight + contentScale = ContentScale.FillBounds ) - Box(modifier = Modifier - .fillMaxWidth() - .clip(RoundedCornerShape(12.dp)) - .combinedClickable( - onClick = { onClickItem(item.id) }, - onLongClick = { onLongClickItem(item.id, item.title) } - ) + Box( + modifier = modifier + .fillMaxSize() + .background(color = ChevitTheme.colors.dimThin) + .padding(vertical = 12.5.dp, horizontal = 14.5.dp), ) { - Column( - modifier = modifier + Box( + modifier = Modifier .fillMaxWidth() - .padding(vertical = 12.5.dp, horizontal = 14.5.dp), + .heightIn(min = 26.dp), + contentAlignment = Alignment.CenterEnd, ) { - Box( - modifier = Modifier - .fillMaxWidth() - .heightIn(min = 26.dp), - contentAlignment = Alignment.CenterEnd, - ) { - if (item.isProgress) { - Box( - modifier = Modifier - .background( - color = ChevitTheme.colors.grey10, - shape = RoundedCornerShape(100.dp), - ) - .border( - width = 1.dp, - color = ChevitTheme.colors.grey4, - shape = RoundedCornerShape(100.dp), - ) - .padding(horizontal = 14.dp, vertical = 4.dp), - contentAlignment = Alignment.Center, - ) { - Text( - text = "진행중", - style = ChevitTheme.typhography.bodySmall.copy(color = ChevitTheme.colors.white), + if (item.isProgress) { + Box( + modifier = Modifier + .background( + color = ChevitTheme.colors.grey10, + shape = RoundedCornerShape(100.dp), ) - } + .border( + width = 1.dp, + color = ChevitTheme.colors.grey4, + shape = RoundedCornerShape(100.dp), + ) + .padding(horizontal = 14.dp, vertical = 4.dp), + contentAlignment = Alignment.Center, + ) { + Text( + text = "진행중", + style = ChevitTheme.typhography.bodySmall.copy(color = ChevitTheme.colors.white), + ) } } + } + Column(modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Bottom) { Text( text = item.title, style = ChevitTheme.typhography.headlineSmall.copy(color = ChevitTheme.colors.white), @@ -97,6 +98,7 @@ fun MyChecklistItem( style = ChevitTheme.typhography.bodySmall.copy(color = ChevitTheme.colors.white), ) } + } } }