-
Notifications
You must be signed in to change notification settings - Fork 0
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
[TNT-180] 트레이니 주간 캘린더 연동 #67
Conversation
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.
기획에 맞게 캘린더 조정이 필요할 것으로 보입니다 !_!
val now = LocalDate.now() | ||
val coroutineScope = rememberCoroutineScope() | ||
|
||
val weekCalendarState = rememberWeekCalendarState( |
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.
우리 앱의 첫번째 요일은 '일요일'이므로 별도로 FirstDayOfWeek
선언해주는게 좋을 것 같습니다 ~
.padding(horizontal = 20.dp, vertical = 8.dp), | ||
) { | ||
Spacer(Modifier.height(8.dp)) | ||
TnTCalendarSelector( |
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.
요거 제 브랜치에서 TnTHomeTopBar
만들어뒀어요! 체리픽해서 사용하면 조을 것 같습니당
} | ||
Spacer(modifier = Modifier.height(16.dp)) | ||
TnTIndicatorWeekCalendar( |
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.
최소 날짜, 최대 날짜 지정이 필요할 것 같습니다!
} | ||
} | ||
|
||
private fun moveToNextWeek() { |
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.
7일 중 과반 이상(4개 이상)이 해당하는 년도-월로 표시
현재 보이는 '연월'은 위 기획과 동일하게 설정되도록 수정이 필요할 것 같아요!
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.
GOOD 👍👍👍
private fun getDominantYearMonth(visibleDays: List<LocalDate>): YearMonth { | ||
val yearMonthCount = visibleDays.groupingBy { YearMonth.from(it) }.eachCount() | ||
|
||
return yearMonthCount.entries | ||
.sortedByDescending { it.value } | ||
.firstOrNull { it.value >= 4 }?.key | ||
?: YearMonth.from(visibleDays.first()) | ||
} |
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.
private fun getDominantYearMonth(visibleDays: List<LocalDate>): YearMonth { | |
val yearMonthCount = visibleDays.groupingBy { YearMonth.from(it) }.eachCount() | |
return yearMonthCount.entries | |
.sortedByDescending { it.value } | |
.firstOrNull { it.value >= 4 }?.key | |
?: YearMonth.from(visibleDays.first()) | |
} | |
private fun getMostFrequentYearMonth(visibleDays: List<LocalDate>): YearMonth { | |
return visibleDays | |
.groupingBy { YearMonth.from(it) } | |
.eachCount() | |
.maxBy { it.value } | |
.key | |
} |
요거 단순하게 Grouping
한 후에 값이 가장 많은 YearMonth
로 넘겨주는건 어떨까요?
캘린더 상에서 과반이 항상 4일 이상을 의미하는건 아닐 것 같아요!
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.
옹 넵 수정하고 머지하겠습니다!! 🙇
- jpg, jpeg, png, svg만 가능하다 - 만약 지원하지 않는 형식의 파일이 들어오면 png로 바꿔준다
📝 작업 내용
[TNT-180] 트레이니의 주간 기록 출력 #43
트레이니 홈 화면 주간 캘린더 연동했습니다.
알림 아이콘 클릭 시 알림 화면으로 이동하도록 수정했습니다.
📸 실행 화면
TraineeHomeWeekCalendar.mp4
🙆🏻 리뷰 요청 사항
없습니다!
👀 레퍼런스