Repository navigation
fix(timeletter): 리스트/블록 아이템 레이아웃 정합 및 수신인 문구 수정 (#493) #1708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
e83bb82
fd1cdc7
c93ada7
d26622d
34e1de7
d266b21
d08dce8
2a41cef
0320355
08fd64d
839e61b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ import androidx.compose.runtime.setValue | |
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.layout.ContentScale | ||
| import androidx.compose.ui.platform.LocalInspectionMode | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.text.font.FontWeight | ||
| import androidx.compose.ui.text.style.TextOverflow | ||
|
|
@@ -31,6 +32,7 @@ import androidx.compose.ui.unit.dp | |
| import coil3.compose.AsyncImage | ||
| import com.afternote.core.ui.theme.AfternoteDesign | ||
| import com.afternote.feature.timeletter.domain.model.TimeLetter | ||
| import com.afternote.feature.timeletter.domain.model.TimeLetterBlock | ||
| import com.afternote.feature.timeletter.domain.model.TimeLetterBlockType | ||
| import com.afternote.feature.timeletter.domain.model.TimeLetterStatus | ||
|
|
||
|
|
@@ -44,25 +46,36 @@ fun TimeLetterListItem( | |
| ) { | ||
| var showMenu by remember { mutableStateOf(false) } | ||
|
|
||
| Row(modifier = modifier) { | ||
| Row( | ||
| modifier = | ||
| modifier | ||
| .border( | ||
| width = 1.dp, | ||
| color = AfternoteDesign.colors.gray4, | ||
| shape = RoundedCornerShape(size = 6.dp), | ||
| ).padding(horizontal = 16.dp), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Column( | ||
| modifier = | ||
| Modifier | ||
| .border( | ||
| width = 1.dp, | ||
| color = AfternoteDesign.colors.gray4, | ||
| shape = RoundedCornerShape(size = 6.dp), | ||
| ).fillMaxWidth() | ||
| .padding(vertical = 19.dp, horizontal = 15.dp), | ||
| .weight(1f) | ||
| .padding(vertical = 19.dp), | ||
| ) { | ||
| Row( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Text( | ||
| text = "수신인 ${ | ||
| letter.receiverIds.mapNotNull { receiverNameMap[it] }.joinToString(", ") | ||
| .ifEmpty { "${letter.receiverIds.size}명" } | ||
| if (letter.receiverIds.isEmpty()) { | ||
| "수신자 정보 없음" | ||
| } else { | ||
| letter.receiverIds | ||
| .mapNotNull { receiverNameMap[it] } | ||
| .joinToString(", ") | ||
| .ifEmpty { "${letter.receiverIds.size}명" } | ||
| } | ||
| }", | ||
| style = AfternoteDesign.typography.footnoteCaption, | ||
| color = AfternoteDesign.colors.gray6, | ||
|
|
@@ -73,7 +86,7 @@ fun TimeLetterListItem( | |
| style = AfternoteDesign.typography.footnoteCaption, | ||
| color = AfternoteDesign.colors.gray6, | ||
| ) | ||
| Spacer(modifier = Modifier.width(43.dp)) | ||
| Spacer(modifier = Modifier.width(15.dp)) | ||
| Box { | ||
| Image( | ||
| painterResource(com.afternote.feature.timeletter.presentation.R.drawable.setting), | ||
|
|
@@ -122,11 +135,17 @@ fun TimeLetterListItem( | |
| } | ||
| val thumbUrl = letter.blocks.firstOrNull { it.blockType == TimeLetterBlockType.IMAGE }?.url | ||
| if (thumbUrl != null) { | ||
| Spacer(modifier = Modifier.width(3.dp)) | ||
| AsyncImage( | ||
| model = thumbUrl, | ||
| model = | ||
| if (LocalInspectionMode.current) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preview 에서 Coil 이 URL 을 못 그리는 걸 피하려는 분기로 보입니다. 동작은 맞지만 프로덕션 컴포저블에 미리보기 전용 분기가 들어가는 셈이라, 썸네일 model 을 인자로 받게 하거나(Preview 에서 drawable 을 넘김) Coil 의 |
||
| com.afternote.feature.timeletter.presentation.R.drawable.container | ||
| } else { | ||
| thumbUrl | ||
| }, | ||
| contentDescription = null, | ||
| contentScale = ContentScale.Crop, | ||
| modifier = Modifier.size(60.dp), | ||
| modifier = Modifier.size(80.dp), | ||
| ) | ||
| } | ||
| } | ||
|
|
@@ -148,3 +167,31 @@ private fun TimeLetterItemPreview() { | |
| ), | ||
| ) | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun TimeLetterItemWithImagePreview() { | ||
| TimeLetterListItem( | ||
| letter = | ||
| TimeLetter( | ||
| id = 1L, | ||
| title = "미래의 나에게", | ||
| sendAt = "2026-12-31T00:00:00", | ||
| deliveredAt = null, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. develop 에서 |
||
| status = TimeLetterStatus.SCHEDULED, | ||
| blocks = | ||
| listOf( | ||
| TimeLetterBlock( | ||
| id = 1L, | ||
| blockType = TimeLetterBlockType.IMAGE, | ||
| blockOrder = 1, | ||
| textContent = null, | ||
| url = "preview-image", | ||
| mimeType = "image/png", | ||
| ), | ||
| ), | ||
| receiverIds = listOf(1L), | ||
| ), | ||
| receiverNameMap = mapOf(1L to "박경민"), | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TimeLetterBlockItem.kt81행과 같은 분기가 그대로 복사돼 있습니다. 문구 규칙이 다시 바뀌면 한쪽만 고쳐지기 쉬우니TimeLetter.receiverLabel(receiverNameMap)같은 함수 하나로 모아 두 곳에서 부르면 좋겠습니다. 이 김에 하드코딩된수신자 정보 없음도 strings.xml 로 옮기면 다른 화면 문구와 맞습니다.