-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] 하루요약(홈) 화면 UI 구현 #23 #28
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
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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="6dp" | ||
| android:height="10dp" | ||
| android:viewportWidth="6" | ||
| android:viewportHeight="10"> | ||
| <path | ||
| android:pathData="M0.994,0.994L4.969,4.969L0.994,8.945" | ||
| android:strokeLineJoin="round" | ||
| android:strokeWidth="0.993827" | ||
| android:fillColor="#00000000" | ||
| android:strokeColor="#313131" | ||
| android:strokeLineCap="round"/> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="14dp" | ||
| android:height="16dp" | ||
| android:viewportWidth="14" | ||
| android:viewportHeight="16"> | ||
| <path | ||
| android:pathData="M12.469,4.224C11.981,3.221 10.573,2.4 8.936,2.878C8.154,3.104 7.471,3.589 7,4.253C6.529,3.589 5.846,3.104 5.064,2.878C3.423,2.408 2.019,3.221 1.53,4.224C0.845,5.627 1.129,7.206 2.376,8.916C3.354,10.255 4.75,11.611 6.777,13.186C6.842,13.236 6.92,13.263 7.002,13.263C7.083,13.263 7.162,13.236 7.226,13.186C9.25,11.615 10.65,10.269 11.627,8.916C12.87,7.206 13.155,5.627 12.469,4.224Z" | ||
| android:fillColor="#8A8A8A"/> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
| android:width="14dp" | ||
| android:height="16dp" | ||
| android:viewportWidth="14" | ||
| android:viewportHeight="16"> | ||
| <path | ||
| android:pathData="M7,13H7" | ||
| android:strokeWidth="2" | ||
| android:fillColor="#00000000" | ||
| android:strokeColor="#8A8A8A" | ||
| android:strokeLineCap="round"/> | ||
| <path | ||
| android:pathData="M7,3V10" | ||
| android:strokeWidth="2" | ||
| android:fillColor="#00000000" | ||
| android:strokeColor="#8A8A8A" | ||
| android:strokeLineCap="round"/> | ||
| </vector> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.konkuk.medicarecall.domain.model.type | ||
|
|
||
| enum class HomeStatusType(val title: String) { | ||
| GOOD("양호"), | ||
| ATTENTION("관심"), | ||
| WARNING("주의"), | ||
| UNRECORDED("미기록") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| package com.konkuk.medicarecall.ui.feature.home.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.border | ||
| import androidx.compose.foundation.clickable | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.remember | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
| import com.konkuk.medicarecall.domain.util.now | ||
| import com.konkuk.medicarecall.resources.Res | ||
| import com.konkuk.medicarecall.resources.ic_arrow_big_back | ||
| import com.konkuk.medicarecall.resources.ic_arrow_big_forward | ||
| import com.konkuk.medicarecall.ui.theme.MediCareCallTheme | ||
| import com.konkuk.medicarecall.ui.theme.White | ||
| import com.konkuk.medicarecall.ui.theme.gray6 | ||
| import kotlinx.datetime.LocalDate | ||
| import kotlinx.datetime.number | ||
| import org.jetbrains.compose.resources.vectorResource | ||
|
|
||
| @Composable | ||
| fun DateBar( | ||
| day: LocalDate, | ||
| onBack: () -> Unit = {}, | ||
| onNext: () -> Unit = {}, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| val todayString by remember { if (day == LocalDate.now()) mutableStateOf("(오늘)") else mutableStateOf("") } | ||
|
|
||
| Box( | ||
| Modifier | ||
| .background(White) | ||
| .border(0.5.dp, MediCareCallTheme.colors.gray1), | ||
| ) { | ||
| Row( | ||
| Modifier | ||
| .fillMaxWidth() | ||
| .padding( | ||
| horizontal = 16.dp, vertical = 16.dp, | ||
| ), | ||
| horizontalArrangement = Arrangement.SpaceBetween, | ||
| ) { | ||
| Icon( | ||
| imageVector = vectorResource(Res.drawable.ic_arrow_big_back), | ||
| contentDescription = "하루 전으로", | ||
| tint = MediCareCallTheme.colors.gray6, | ||
| modifier = Modifier.clickable(onClick = onBack), | ||
| ) | ||
| Text( | ||
| "${day.month.number}월 ${day.day}일 $todayString", | ||
| color = gray6, | ||
| style = MediCareCallTheme.typography.M_16, | ||
| ) | ||
| Icon( | ||
| imageVector = vectorResource(Res.drawable.ic_arrow_big_forward), | ||
| contentDescription = "하루 뒤로", | ||
| tint = if (day == LocalDate.now()) MediCareCallTheme.colors.gray2 else MediCareCallTheme.colors.gray6, | ||
| modifier = Modifier.clickable(enabled = day != LocalDate.now(), onClick = onNext), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| package com.konkuk.medicarecall.ui.feature.home.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.border | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Row | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Icon | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.unit.dp | ||
| import androidx.compose.ui.unit.sp | ||
| import com.konkuk.medicarecall.domain.model.type.HomeStatusType | ||
| import com.konkuk.medicarecall.resources.Res | ||
| import com.konkuk.medicarecall.resources.ic_heart_small | ||
| import com.konkuk.medicarecall.ui.theme.Black | ||
| import com.konkuk.medicarecall.ui.theme.MediCareCallTheme | ||
| import com.konkuk.medicarecall.ui.theme.White | ||
| import com.konkuk.medicarecall.ui.theme.gray1 | ||
| import com.konkuk.medicarecall.ui.theme.gray4 | ||
| import org.jetbrains.compose.resources.vectorResource | ||
|
|
||
| @Composable | ||
| fun HomeRemarksCard( | ||
| remarkStatus: HomeStatusType, | ||
| remarkTitle: String, | ||
| remarkDescription: String, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Box( | ||
| modifier.background(White, RoundedCornerShape(16.dp)) | ||
| .border(1.dp, gray1, RoundedCornerShape(16.dp)), | ||
| ) { | ||
| Column(Modifier.padding(16.dp)) { | ||
| Row( | ||
| horizontalArrangement = Arrangement.spacedBy(6.dp), | ||
| verticalAlignment = Alignment.CenterVertically, | ||
| ) { | ||
| Icon(imageVector = vectorResource(Res.drawable.ic_heart_small), contentDescription = "특이사항", tint = gray4) | ||
| Text("특이사항", color = gray4, style = MediCareCallTheme.typography.R_14) | ||
| } | ||
| Spacer(Modifier.height(15.dp)) | ||
| HomeStatusChip(remarkStatus) | ||
| Spacer(Modifier.height(8.dp)) | ||
| Text(remarkTitle, color = Black, style = MediCareCallTheme.typography.B_20) | ||
| Spacer(Modifier.height(6.dp)) | ||
| Text(remarkDescription, color = gray4, style = MediCareCallTheme.typography.M_16.copy(fontSize = 12.sp)) | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package com.konkuk.medicarecall.ui.feature.home.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.Color | ||
| import androidx.compose.ui.unit.dp | ||
| import com.konkuk.medicarecall.domain.model.type.HomeStatusType | ||
| import com.konkuk.medicarecall.ui.theme.G50 | ||
| import com.konkuk.medicarecall.ui.theme.MediCareCallTheme | ||
| import com.konkuk.medicarecall.ui.theme.Negative | ||
| import com.konkuk.medicarecall.ui.theme.Warning2 | ||
| import com.konkuk.medicarecall.ui.theme.gray3 | ||
| import com.konkuk.medicarecall.ui.theme.main | ||
|
|
||
| @Composable | ||
| fun HomeStatusChip( | ||
| statusType: HomeStatusType, | ||
| modifier: Modifier = Modifier, | ||
|
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# HomeStatusChip에서 modifier가 실제 적용되는지 정적 확인
rg -nP --type=kt 'fun HomeStatusChip\(|Box\(Modifier\.background|Box\(modifier\.background' composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.kt
# 기대 결과:
# - 기존 코드: Box(Modifier.background...) 매치
# - 수정 후: Box(modifier.background...) 매치Repository: Medicare-Call/Medicare-Call-KMP Length of output: 101 🏁 Script executed: # 파일 크기 확인
wc -l composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.ktRepository: Medicare-Call/Medicare-Call-KMP Length of output: 178 🏁 Script executed: # 파일 전체 내용 읽기
cat -n composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.ktRepository: Medicare-Call/Medicare-Call-KMP Length of output: 2206 🏁 Script executed: # modifier 관련 라인 검색 (Kotlin 파일이므로 kotlin 타입이 아니라 키워드로 검색)
rg -n 'modifier|Box\(' composeApp/src/commonMain/kotlin/com/konkuk/medicarecall/ui/feature/home/component/HomeStatusChip.ktRepository: Medicare-Call/Medicare-Call-KMP Length of output: 352
Line 23에서 🔧 제안 diff- Box(Modifier.background(containerColor, RoundedCornerShape(20.dp))) {
+ Box(modifier.background(containerColor, RoundedCornerShape(20.dp))) {
Text(statusType.title, color = textColor, style = MediCareCallTheme.typography.SB_12, modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp))
}Also applies to: 50-51 🤖 Prompt for AI Agents |
||
| ) { | ||
| val containerColor: Color | ||
| val textColor: Color | ||
|
|
||
| when (statusType) { | ||
| HomeStatusType.GOOD -> { | ||
| containerColor = G50 | ||
| textColor = main | ||
| } | ||
|
|
||
| HomeStatusType.ATTENTION -> { | ||
| containerColor = Color(0xffFFA13d).copy(alpha = 0.1f) | ||
| textColor = Warning2 | ||
| } | ||
|
|
||
| HomeStatusType.WARNING -> { | ||
| containerColor = Negative.copy(alpha = 0.1f) | ||
| textColor = Negative | ||
| } | ||
|
|
||
| HomeStatusType.UNRECORDED -> { | ||
| containerColor = Color(0xffF0F0F0) | ||
| textColor = gray3 | ||
| } | ||
| } | ||
|
|
||
| Box(Modifier.background(containerColor, RoundedCornerShape(20.dp))) { | ||
| Text(statusType.title, color = textColor, style = MediCareCallTheme.typography.SB_12, modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp)) | ||
| } | ||
| } | ||
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.
todayString이day변경 시 업데이트되지 않는 버그remember { mutableStateOf(...) }는 초기 컴포지션 시 한 번만 계산됩니다.day파라미터가 변경되어도todayString값이 재계산되지 않아 날짜 네비게이션 시 "(오늘)" 표시가 정상 동작하지 않습니다.🐛 수정 제안
📝 Committable suggestion
🤖 Prompt for AI Agents