Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: CalendarInfoBox 보면 문자열이 끊기거나 안보이는 이슈가 있는 듯하여 modifier 어떻게 적용하면 되는지 해당 코드 일단 올려놓겠습니다

@Composable
fun CalendarInfoBox(data: ScheduleEntity) {
    Column(
        modifier = Modifier
            .fillMaxWidth()
            .border(0.5.dp, CrowdZeroTheme.colors.gray500, shape = RoundedCornerShape(15.dp))
            .clip(RoundedCornerShape(15.dp))
            .background(CrowdZeroTheme.colors.white)
            .padding(dimensionResource(R.dimen.default_padding))
    ) {
        Text(
            text = data.duration,
            style = CrowdZeroTheme.typography.c4SemiBold,
            color = CrowdZeroTheme.colors.green600
        )
        Row(
            modifier = Modifier
                .fillMaxWidth()
                .padding(vertical = 2.dp),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(
                modifier = Modifier
                    .padding(end = 8.dp)
                    .weight(1f),
                text = data.location.replace("\n", " "), 
                style = CrowdZeroTheme.typography.h5Bold,
                color = CrowdZeroTheme.colors.gray900
            )
            Text(
                modifier = Modifier.wrapContentSize(),
                text = data.region.replace("", " "),
                style = CrowdZeroTheme.typography.c4SemiBold,
                color = CrowdZeroTheme.colors.gray600
            )
        }
        Row(
            modifier = Modifier.fillMaxWidth(),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(
                modifier = Modifier.padding(end = 4.dp),
                text = stringResource(R.string.calendar_people_reporting_title),
                style = CrowdZeroTheme.typography.c3Regular,
                color = CrowdZeroTheme.colors.gray600
            )
            Text(
                modifier = Modifier.padding(end = 8.dp),
                text = stringResource(R.string.calendar_people_reporting, data.people),
                style = CrowdZeroTheme.typography.c3Regular,
                color = CrowdZeroTheme.colors.gray800
            )
            Text(
                modifier = Modifier.padding(end = 8.dp),
                text = stringResource(R.string.calendar_slash),
                style = CrowdZeroTheme.typography.c3Regular,
                color = CrowdZeroTheme.colors.gray600
            )
            Text(
                modifier = Modifier.padding(end = 4.dp),
                text = stringResource(R.string.calendar_jurisdiction),
                style = CrowdZeroTheme.typography.c3Regular,
                color = CrowdZeroTheme.colors.gray600
            )
            Text(
                text = data.jurisdiction.replace("\n", " "),
                style = CrowdZeroTheme.typography.c3Regular,
                color = CrowdZeroTheme.colors.gray800
            )
        }
    }
}
``

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

region이 옆으로 밀리는 현상을 해결하려면 modifier에 wrapContentSize()를 주고, "명동 동" 이렇게 오는 경우가 있어서 이럴 경우 "명동"으로만 보이게 replace 함수 추가해두었습니답

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
혹시 요거 말하는 건가?? '명동 동'이 아니라 '명동 등'인데 그래도 고쳐? (이동하는 집회라 '등'으로 표기해둔 듯)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.... 노안 이슈.....에효효효

Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ 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(
Expand All @@ -45,6 +48,7 @@ fun CalendarComponent(
onDateSelected: (LocalDate) -> Unit,
) {
val days = remember(currentMonth) { getDaysForMonth(currentMonth) }
val firstDayOfWeek = DayOfWeek.SUNDAY // 일요일을 주의 시작으로 변경

Column(
modifier = Modifier
Expand Down Expand Up @@ -93,7 +97,17 @@ fun CalendarComponent(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceAround
) {
immutableListOf("일", "월", "화", "수", "목", "금", "토").forEach { day ->
val weekDays = immutableListOf(
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,
Expand All @@ -106,11 +120,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(
Expand Down
40 changes: 26 additions & 14 deletions feature/src/main/java/com/gdg/feature/calendar/CalendarRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -222,29 +222,33 @@ fun CalendarInfoBox(data: ScheduleEntity) {
.background(CrowdZeroTheme.colors.white)
.padding(dimensionResource(R.dimen.default_padding))
) {
Text(
text = data.duration,
style = CrowdZeroTheme.typography.c4SemiBold,
color = CrowdZeroTheme.colors.green600
)
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 2.dp),
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Text(
modifier = Modifier.padding(end = 8.dp),
text = data.location,
style = CrowdZeroTheme.typography.h5Bold,
color = CrowdZeroTheme.colors.gray900
text = data.duration,
style = CrowdZeroTheme.typography.c4SemiBold,
color = CrowdZeroTheme.colors.green600
)
Text(
text = data.region,
style = CrowdZeroTheme.typography.c4SemiBold,
color = CrowdZeroTheme.colors.gray600
color = CrowdZeroTheme.colors.white,
modifier = Modifier
.background(
color = CrowdZeroTheme.colors.green600,
shape = RoundedCornerShape(30.dp)
)
.padding(horizontal = 8.dp, vertical = 3.dp)
)
}
Text(
text = data.location.replace("\n", " "),
style = CrowdZeroTheme.typography.h5Bold,
color = CrowdZeroTheme.colors.gray900
)
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
Expand Down Expand Up @@ -274,7 +278,7 @@ fun CalendarInfoBox(data: ScheduleEntity) {
color = CrowdZeroTheme.colors.gray600
)
Text(
text = data.jurisdiction,
text = data.jurisdiction.replace("\n", " "),
style = CrowdZeroTheme.typography.c3Regular,
color = CrowdZeroTheme.colors.gray800
)
Expand All @@ -296,11 +300,19 @@ fun CalendarScreenPreview() {
region = "한남동",
people = "3000",
jurisdiction = "용산"
),
ScheduleEntity(
date = LocalDate.now().toString(),
duration = "07:30 ~ 24:00",
location = "두터교회 앞 인도 및 2개 차로두터교회 앞 인도 및 2개 차로두터교회 앞 인도 및 2개 차로",
region = "한남동",
people = "3000",
jurisdiction = "용산"
)
)
),
selectedDate = LocalDate.now(),
onDateSelected = {}
)
}
}
}
1 change: 1 addition & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<string name="calendar_people_reporting">%1$s명</string>
<string name="calendar_slash">/</string>
<string name="calendar_jurisdiction">관할시</string>
<string name="calendar_jurisdiction_rest">", "</string>
<string name="calendar_no_info">해당 날짜의 집회 정보가 없습니다</string>
<string name="calendar_not_connected">해당 날짜의 집회 정보를 가져오지 못했어요</string>
<string name="detail_congestion_state_failure">혼잡도 api 오류 : %1$s</string>
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ naver-map-compose = "1.7.2"
naver-map-location = "21.0.2"
play-services-location = "21.0.1"


[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } # Kotlin Symbol Processing (KSP) 플러그인
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } # Kotlin Android 플러그인
Expand Down