Skip to content

[Feature/#23] : 코드 리팩토링 #24

Merged
gaeulzzang merged 9 commits intodevelopfrom
feature/#23-calendar-refactor
Feb 20, 2025
Merged

[Feature/#23] : 코드 리팩토링 #24
gaeulzzang merged 9 commits intodevelopfrom
feature/#23-calendar-refactor

Conversation

@jjwm10625
Copy link
Contributor

@jjwm10625 jjwm10625 commented Feb 18, 2025

✅ 𝗖𝗵𝗲𝗰𝗸-𝗟𝗶𝘀𝘁

  • merge할 브랜치의 위치를 확인해 주세요.(main❌/develop⭕)
  • 리뷰가 필요한 경우 리뷰어를 지정해 주세요.
  • 리뷰는 PR이 올라오면 최대한 빠르게 진행합니다.
  • P1 단계의 리뷰는 빠르게 확인 후 반영합니다.
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다.

📌 𝗜𝘀𝘀𝘂𝗲𝘀

📎 𝗪𝗼𝗿𝗸 𝗗𝗲𝘀𝗰𝗿𝗶𝗽𝘁𝗶𝗼𝗻

  • 달력 컴포넌트 요일, 날짜 일치하도록 수정 + 일요일을 주의 시작으로 바꿈
  • 집회정보 컴포넌트 - 긴 문구 단위로 줄바꿈
    • 집회정보 컴포넌트 - 관할시 가로 배열

📷 𝗦𝗰𝗿𝗲𝗲𝗻𝘀𝗵𝗼𝘁

Screenshot_20250219_140722

💬 𝗧𝗼 𝗥𝗲𝘃𝗶𝗲𝘄𝗲𝗿𝘀

문제. 집회 장소가 길어질 경우, 우측의 장소가 밀려서 세로로 배열됨
스크린샷 2025-02-19 오전 4 26 48

해결한 방법: 일정 글자수 초과시, 줄바꿈을 함. (단, 단어가 잘리지 않도록 유의함)

하지만 이 경우에도 문제가 있음..
화살표가 들어간 경로는 줄바꿈이 이미 존재함!!

ex) 세종호텔 앞 > 운현하늘빌딩
※행진경로(2km, 1개차로): 세종호텔+한은R+을1R>종각R
안국R>운현하늘빌딩

그래서 이걸 글자수로 자르면 아래 사진처럼 어정쩡하게 나타남..
개선된 사항은 우측에 적힌 장소가 밀리지 않는다는 점?
스크린샷 2025-02-19 오전 4 27 16
어떻게 하는 게 좋을까용..

@jjwm10625 jjwm10625 self-assigned this Feb 18, 2025
@jjwm10625 jjwm10625 requested a review from a team as a code owner February 18, 2025 19:41
@jjwm10625 jjwm10625 changed the title Feature/#23 calendar refactor [Feature/#23] : 코드 리팩토링 Feb 18, 2025
Copy link
Contributor

@nhyeonii nhyeonii left a comment

Choose a reason for hiding this comment

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

헉 .. 진짜 수정이 쉽지 않네유 .. 😭 그래도 리팩토링 고생하셨습니다 🥹

Copy link
Contributor

@gaeulzzang gaeulzzang left a comment

Choose a reason for hiding this comment

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

문자열 이슈 해결 방법 적어놓았으니까 코리 반영해서 다시 수정해주시와요

Text(
modifier = Modifier.padding(end = 8.dp),
text = data.location,
text = data.location.chunked(45).joinToString("\n"), // 긴 문구 단어 단위로 줄바꿈
Copy link
Contributor

Choose a reason for hiding this comment

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

P1: 45자 단위로 제한할 경우 기기 크기에 따라 줄바꿈이 안예쁘게 이뤄지기 때문에 글자수를 기준으로 줄바꿈해서는 안됩니다. 줄바꿈을 공백으로 변경하는게 훨씬 깔끔해집니답. 그리고 해당 text modifier에 weight(1f) 적용해주세요

Suggested change
text = data.location.chunked(45).joinToString("\n"), // 긴 문구 단어 단위로 줄바꿈
text = data.location.replace("\n", " ")

)
Text(
text = data.jurisdiction,
text = data.jurisdiction.split("\n").joinToString(stringResource(R.string.calendar_jurisdiction_rest)),
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: 쉼표보다는 띄어쓰기로 표현하는게 더 나은 것 같슈

Suggested change
text = data.jurisdiction.split("\n").joinToString(stringResource(R.string.calendar_jurisdiction_rest)),
text = data.jurisdiction.replace("\n", " "),

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.

남대문, 종 로 이게 낫다는거지??

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.

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

horizontalArrangement = Arrangement.SpaceAround
) {
immutableListOf("일", "월", "화", "수", "목", "금", "토").forEach { day ->
val weekDays = listOf(
Copy link
Contributor

@gaeulzzang gaeulzzang Feb 19, 2025

Choose a reason for hiding this comment

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

P1: 불변하지 않는 애들이기 때문에 immutableListOf로 수정 ㄱㄱ

@gaeulzzang gaeulzzang merged commit a4324fc into develop Feb 20, 2025
1 check passed
@gaeulzzang gaeulzzang deleted the feature/#23-calendar-refactor branch February 20, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] : 캘린더 화면 리팩토링

3 participants