-
Notifications
You must be signed in to change notification settings - Fork 2
[Feature] 콜밴 글쓰기 날짜 선택 필드 추가 #1324
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
Changes from all commits
1b6e872
e5a40df
74712a4
63ad29b
20cfac0
388620f
cbdc7ac
e23eb47
4f1bf67
514ef7d
582cb53
0945a35
28b5454
6a01da1
8ad2f03
a89a810
b944cd8
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,255 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| package `in`.koreatech.koin.feature.callvan.ui.create.component | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.animation.AnimatedVisibility | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.animation.core.animateFloatAsState | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.animation.expandVertically | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.animation.shrinkVertically | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.background | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.clickable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Arrangement | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Column | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.Row | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.fillMaxWidth | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.padding | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.foundation.layout.size | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material.icons.Icons | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material.icons.filled.KeyboardArrowDown | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.Card | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.CardDefaults | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.HorizontalDivider | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.Icon | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.material3.Text | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.runtime.Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.runtime.getValue | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.runtime.remember | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.Alignment | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.draw.rotate | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.res.stringResource | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.tooling.preview.Preview | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import androidx.compose.ui.unit.dp | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.core.designsystem.theme.RebrandKoinTheme | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import `in`.koreatech.koin.feature.callvan.R | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.time.LocalDate | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import java.time.YearMonth | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import kotlinx.collections.immutable.persistentListOf | ||||||||||||||||||||||||||||||||||||||||||||||||||
| import kotlinx.collections.immutable.toPersistentList | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fun CallvanDateField( | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 39 in feature/callvan/src/main/java/in/koreatech/koin/feature/callvan/ui/create/component/CallvanDateField.kt
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| formattedDate: String, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isPickerVisible: Boolean, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedYear: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedMonth: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedDay: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier: Modifier = Modifier, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onFieldClick: () -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onDayChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onReset: () -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onConfirm: () -> Unit = {} | ||||||||||||||||||||||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val arrowRotation by animateFloatAsState( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| targetValue = if (isPickerVisible) 180f else 0f, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| label = "arrowRotation" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Column(modifier = modifier.fillMaxWidth()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Column( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .padding(horizontal = 24.dp, vertical = 12.dp), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.spacedBy(4.dp) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanSectionHeader( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| label = stringResource(R.string.callvan_create_date_label), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| hint = stringResource(R.string.callvan_create_date_hint) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Row( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .background(RebrandKoinTheme.colors.neutral100, RebrandKoinTheme.shapes.small) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .clickable(onClick = onFieldClick) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+69
to
+73
Contributor
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. [Minor] 접근성 — 클릭 가능한 Row에 시맨틱 역할 누락
Suggested change
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| .padding(horizontal = 12.dp, vertical = 8.dp), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| horizontalArrangement = Arrangement.SpaceBetween, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| verticalAlignment = Alignment.CenterVertically | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Text( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| text = formattedDate, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| style = RebrandKoinTheme.typography.regular14, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| color = RebrandKoinTheme.colors.neutral800 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Icon( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| imageVector = Icons.Default.KeyboardArrowDown, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| contentDescription = null, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
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. [Minor] 접근성(Accessibility) - contentDescription 누락
Icon(
imageVector = Icons.Default.KeyboardArrowDown,
contentDescription = if (isPickerVisible) {
stringResource(R.string.callvan_create_date_picker_collapse)
} else {
stringResource(R.string.callvan_create_date_picker_expand)
},
...
)
Contributor
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. [Minor] 접근성(Accessibility): 피커 열림/닫힘 상태를 나타내는 아이콘에 이 아이콘은 단순 장식이 아니라 UI 상태(펼침/접힘)를 시각적으로 전달하므로 스크린 리더 사용자를 위해 동적 설명을 제공해야 합니다.
Suggested change
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| tint = RebrandKoinTheme.colors.neutral800, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .size(24.dp) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .rotate(arrowRotation) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| AnimatedVisibility( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| visible = isPickerVisible, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| enter = expandVertically(), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| exit = shrinkVertically() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanDatePickerCard( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedYear = selectedYear, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedMonth = selectedMonth, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedDay = selectedDay, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange = onYearChange, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange = onMonthChange, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onDayChange = onDayChange, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onReset = onReset, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onConfirm = onConfirm | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| private fun CallvanDatePickerCard( | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Check warning on line 113 in feature/callvan/src/main/java/in/koreatech/koin/feature/callvan/ui/create/component/CallvanDateField.kt
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedYear: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedMonth: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedDay: Int, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier: Modifier = Modifier, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onDayChange: (Int) -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onReset: () -> Unit = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onConfirm: () -> Unit = {} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val today = remember { LocalDate.now() } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val currentYear = remember { today.year } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val currentMonth = remember { today.monthValue } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val currentDay = remember { today.dayOfMonth } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val years = remember { persistentListOf("${currentYear}년", "${currentYear + 1}년") } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
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. [Major] 과거 날짜 선택 가능 - 비즈니스 로직 검증 누락 현재 연도와 다음 연도만 표시하지만, 같은 연도 내에서 이미 지난 날짜를 선택하는 것을 막는 로직이 없습니다. 콜밴 출발 날짜를 오늘 이전으로 설정하면 서버 요청 실패 또는 잘못된 데이터가 저장될 수 있습니다. 최소한 // ViewModel 또는 UseCase에서
val today = LocalDate.now()
val selectedDate = LocalDate.of(selectedYear, selectedMonth, selectedDay)
require(selectedDate >= today) { "출발 날짜는 오늘 이후여야 합니다." }UI 레벨에서도 현재 연도를 선택했을 때 지난 달을 선택하지 못하도록
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. 수정이 필요해보입니다. |
||||||||||||||||||||||||||||||||||||||||||||||||||
| val startMonth = remember(selectedYear) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if (selectedYear == currentYear) currentMonth else 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val months = remember(selectedYear) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (startMonth..12).map { "${it}월" }.toPersistentList() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val startDay = remember(selectedYear, selectedMonth) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if (selectedYear == currentYear && selectedMonth == currentMonth) currentDay else 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val days = remember(selectedYear, selectedMonth) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val daysCount = YearMonth.of(selectedYear, selectedMonth).lengthOfMonth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (startDay..daysCount).map { "${it}일" }.toPersistentList() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| val yearIndex = remember(selectedYear, currentYear) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (selectedYear - currentYear).coerceIn(0, years.size - 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val monthIndex = remember(selectedMonth, startMonth) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (selectedMonth - startMonth).coerceIn(0, months.size - 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val dayIndex = remember(selectedDay, startDay, days.size) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| (selectedDay - startDay).coerceIn(0, days.size - 1) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+143
to
+151
Contributor
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. [Minor]
Suggested change
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Card( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .padding(horizontal = 24.dp), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| shape = RebrandKoinTheme.shapes.small, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| colors = CardDefaults.cardColors(containerColor = RebrandKoinTheme.colors.neutral100), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| elevation = CardDefaults.cardElevation(defaultElevation = 4.dp) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Column( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .fillMaxWidth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .padding(horizontal = 24.dp, vertical = 12.dp), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| verticalArrangement = Arrangement.spacedBy(8.dp) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Row( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.fillMaxWidth() | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanScrollPicker( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| items = years, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedIndex = yearIndex, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onIndexChange = { index -> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val newYear = currentYear + index | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange(newYear) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val newStartDay = if (newYear == currentYear && selectedMonth == currentMonth) currentDay else 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if (selectedDay < newStartDay) onDayChange(newStartDay) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.weight(1f) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanScrollPicker( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| items = months, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedIndex = monthIndex, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onIndexChange = { index -> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val newMonth = startMonth + index | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange(newMonth) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| val newStartDay = if (selectedYear == currentYear && newMonth == currentMonth) currentDay else 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if (selectedDay < newStartDay) onDayChange(newStartDay) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.weight(1f) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanScrollPicker( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| items = days, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedIndex = dayIndex, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onIndexChange = { index -> onDayChange(startDay + index) }, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.weight(1f) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| HorizontalDivider(color = RebrandKoinTheme.colors.neutral200) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Row( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.fillMaxWidth(), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| horizontalArrangement = Arrangement.spacedBy(16.dp, Alignment.End) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Text( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| text = stringResource(R.string.callvan_create_picker_reset), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| style = RebrandKoinTheme.typography.medium14, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| color = RebrandKoinTheme.colors.primary500, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.clickable(onClick = onReset) | ||||||||||||||||||||||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Text( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| text = stringResource(R.string.callvan_create_picker_confirm), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| style = RebrandKoinTheme.typography.medium14, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| color = RebrandKoinTheme.colors.primary500, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| modifier = Modifier.clickable(onClick = onConfirm) | ||||||||||||||||||||||||||||||||||||||||||||||||||
KYM-P marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+204
to
+215
Contributor
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. [Minor]
// 개선 예시
Text(
text = stringResource(R.string.callvan_create_picker_reset),
style = RebrandKoinTheme.typography.medium14,
color = RebrandKoinTheme.colors.primary500,
modifier = Modifier
.clickable(onClick = onReset)
.padding(horizontal = 8.dp, vertical = 12.dp)
)
Comment on lines
+204
to
+215
Contributor
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. [Minor] 접근성 — Text 버튼에
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| @Preview(showBackground = true) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| private fun CallvanDateFieldPreview() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanDateField( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| formattedDate = "2026년 03월 07일", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isPickerVisible = false, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedYear = 2026, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedMonth = 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedDay = 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onFieldClick = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onDayChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onReset = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onConfirm = {} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| @Preview(showBackground = true) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| @Composable | ||||||||||||||||||||||||||||||||||||||||||||||||||
| private fun CallvanDateFieldPickerVisiblePreview() { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| CallvanDateField( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| formattedDate = "2026년 03월 07일", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| isPickerVisible = true, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedYear = 2026, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedMonth = 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| selectedDay = 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onFieldClick = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onYearChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onMonthChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onDayChange = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onReset = {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| onConfirm = {} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
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.
modifier 없어도 되나요