-
Notifications
You must be signed in to change notification settings - Fork 0
[Feature/#23] : 코드 리팩토링 #24
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 5 commits
b37ffcd
81c914c
ff17f96
45d1673
c2f8d0c
a21796b
d4b220c
0bf7f20
d822778
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 |
|---|---|---|
|
|
@@ -33,9 +33,11 @@ import com.gdg.core.designsystem.theme.CrowdZeroAndroidTheme | |
| import com.gdg.core.designsystem.theme.CrowdZeroTheme | ||
| import com.gdg.core.extension.noRippleClickable | ||
| import com.gdg.core.util.getDaysForMonth | ||
| import okhttp3.internal.immutableListOf | ||
| import java.time.DayOfWeek | ||
| import java.time.LocalDate | ||
| import java.time.YearMonth | ||
| import java.time.format.TextStyle | ||
| import java.util.Locale | ||
|
|
||
| @Composable | ||
| fun CalendarComponent( | ||
|
|
@@ -45,6 +47,7 @@ fun CalendarComponent( | |
| onDateSelected: (LocalDate) -> Unit, | ||
| ) { | ||
| val days = remember(currentMonth) { getDaysForMonth(currentMonth) } | ||
| val firstDayOfWeek = DayOfWeek.SUNDAY // 일요일을 주의 시작으로 변경 | ||
|
|
||
| Column( | ||
| modifier = Modifier | ||
|
|
@@ -93,7 +96,17 @@ fun CalendarComponent( | |
| modifier = Modifier.fillMaxWidth(), | ||
| horizontalArrangement = Arrangement.SpaceAround | ||
| ) { | ||
| immutableListOf("일", "월", "화", "수", "목", "금", "토").forEach { day -> | ||
| val weekDays = listOf( | ||
|
||
| DayOfWeek.SUNDAY, | ||
| DayOfWeek.MONDAY, | ||
| DayOfWeek.TUESDAY, | ||
| DayOfWeek.WEDNESDAY, | ||
| DayOfWeek.THURSDAY, | ||
| DayOfWeek.FRIDAY, | ||
| DayOfWeek.SATURDAY | ||
| ) | ||
| weekDays.forEach { dayOfWeek -> | ||
| val day = dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN) | ||
| Text( | ||
| text = day, | ||
| style = CrowdZeroTheme.typography.c2Medium2, | ||
|
|
@@ -106,11 +119,14 @@ fun CalendarComponent( | |
| columns = GridCells.Fixed(7), | ||
| modifier = Modifier.fillMaxWidth() | ||
| ) { | ||
| val emptyDays = (days.first().dayOfWeek.value % 7 - firstDayOfWeek.value + 7) % 7 | ||
| items(emptyDays) { | ||
| Box(modifier = Modifier.aspectRatio(1f)) | ||
| } | ||
| items(days) { date -> | ||
| val isSelected = date == selectedDate | ||
| Box( | ||
| modifier = Modifier | ||
| .weight(1f) | ||
| .aspectRatio(1f) | ||
| .padding(5.dp) | ||
| .background( | ||
|
|
@@ -142,4 +158,4 @@ fun CalendarComponentPreview() { | |
| onDateSelected = {} | ||
| ) | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -235,7 +235,7 @@ fun CalendarInfoBox(data: ScheduleEntity) { | |||||
| ) { | ||||||
| Text( | ||||||
| modifier = Modifier.padding(end = 8.dp), | ||||||
| text = data.location, | ||||||
| text = data.location.chunked(45).joinToString("\n"), // 긴 문구 단어 단위로 줄바꿈 | ||||||
|
||||||
| text = data.location.chunked(45).joinToString("\n"), // 긴 문구 단어 단위로 줄바꿈 | |
| text = data.location.replace("\n", " ") |
Outdated
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.
P2: 쉼표보다는 띄어쓰기로 표현하는게 더 나은 것 같슈
| text = data.jurisdiction.split("\n").joinToString(stringResource(R.string.calendar_jurisdiction_rest)), | |
| text = data.jurisdiction.replace("\n", " "), |
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.
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.
남대문, 종 로 이게 낫다는거지??

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.
P1: CalendarInfoBox 보면 문자열이 끊기거나 안보이는 이슈가 있는 듯하여 modifier 어떻게 적용하면 되는지 해당 코드 일단 올려놓겠습니다
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.
region이 옆으로 밀리는 현상을 해결하려면 modifier에 wrapContentSize()를 주고, "명동 동" 이렇게 오는 경우가 있어서 이럴 경우 "명동"으로만 보이게 replace 함수 추가해두었습니답
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.
혹시 요거 말하는 건가?? '명동 동'이 아니라 '명동 등'인데 그래도 고쳐? (이동하는 집회라 '등'으로 표기해둔 듯)
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.
아.... 노안 이슈.....에효효효