-
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
[FEAT/#41] 채팅방 뷰 구현 #49
Conversation
…PT-all/35-APPJAM-ANDROID-WITHSUHYEON into feat/#41-chat-view # Conflicts: # app/src/main/java/com/sopt/withsuhyeon/feature/chat/ChatScreen.kt
…ID-WITHSUHYEON into feat/#41-chat-view # Conflicts: # app/src/main/java/com/sopt/withsuhyeon/core/navigation/RouteModel.kt
…all/35-APPJAM-ANDROID-WITHSUHYEON into feat/#41-chat-view # Conflicts: # app/src/main/java/com/sopt/withsuhyeon/feature/main/MainScreen.kt
…/SOPT-all/35-APPJAM-ANDROID-WITHSUHYEON into feat/#41-chat-view # Conflicts: # app/src/main/java/com/sopt/withsuhyeon/core/navigation/RouteModel.kt # app/src/main/java/com/sopt/withsuhyeon/feature/main/MainNavigator.kt
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.
채팅방 뷰까지 구현하다니... 레전드 리드!!! 조금만 더 화이팅!!
LaunchedEffect(datePickerState.selectedItem, amPmPickerState.selectedItem, hourPickerState.selectedItem, minutePickerState.selectedItem) { | ||
try { | ||
val selectedDate = datePickerState.selectedItem.toDate() | ||
val selectedTime = LocalTime( | ||
hourPickerState.selectedItem.toTime(amPmPickerState.selectedItem), | ||
minutePickerState.selectedItem.toInt() | ||
) | ||
val selectedDateTime = LocalDateTime(selectedDate, selectedTime) | ||
onDateTimeSelected(selectedDateTime) | ||
} catch (e: Exception) { | ||
println("Error parsing date: ${e.message}") | ||
onDateTimeSelected(null) | ||
} | ||
} |
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.
좋네요! 이 코드 보고 웹에서 sideEffect 처리할 때랑 비슷함을 느꼈습니다!! 저도 Progress에 재적용하겠습니다!
dividerColor = Transparent, | ||
itemPadding = itemPadding, | ||
fadingEdgeGradient = fadingEdgeGradient, | ||
horizontalAlignment = horizontalAlignment, | ||
itemTextAlignment = verticalAlignment, | ||
isInfinity = true | ||
isInfinity = false |
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
shape = RoundedCornerShape(16.dp) | ||
) | ||
.padding(horizontal = 12.dp, vertical = 8.dp) | ||
.widthIn(max = 230.dp) |
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.
우왕 저도 안써봤는데 좋네요!!
textFieldBorderColor | ||
?: when { | ||
value.isNotEmpty() && !isValid -> colors.Red01 | ||
isMaxLengthExceeded -> colors.Red01 | ||
isFocused -> colors.Purple300 | ||
!isValid -> colors.Red01 | ||
else -> colors.Grey100 | ||
} |
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.
애증의 텍스트필드...
fun String.toDate(): LocalDate { | ||
val pattern = Regex("(\\d{1,2})월 (\\d{1,2})일.*") | ||
val match = pattern.matchEntire(this) ?: throw IllegalArgumentException("Invalid date format") | ||
val (month, day) = match.destructured | ||
val currentYear = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).year | ||
return LocalDate(currentYear, month.toInt(), day.toInt()) | ||
} | ||
|
||
fun String.toAllPostRequestDate(): String { | ||
val currentYear = Calendar.getInstance().get(Calendar.YEAR) | ||
|
||
val cleanedDate = this.replace(Regex("""\s*\([가-힣]+\)"""), "") | ||
|
||
val inputFormat = SimpleDateFormat("M/dd, yyyy", Locale.KOREA) | ||
val outputFormat = SimpleDateFormat("yyyy-MM-dd", Locale.KOREA) | ||
|
||
val dateWithYear = "$cleanedDate, $currentYear" | ||
val date = inputFormat.parse(dateWithYear) ?: throw IllegalArgumentException("Invalid date format") | ||
return outputFormat.format(date) | ||
} | ||
|
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 lazyListState = rememberLazyListState() | ||
|
||
LaunchedEffect(messages.size) { | ||
if (messages.isNotEmpty()) { | ||
lazyListState.animateScrollToItem(messages.size - 1) | ||
} | ||
} |
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.
굿굿!!! 뷰 너무 잘 구현해주셨어요 트슛까지 끈기있게 해내서 너무 멋있다...ㅜ 고생하셨어요!
app/src/main/AndroidManifest.xml
Outdated
@@ -25,6 +25,7 @@ | |||
android:name=".feature.main.MainActivity" | |||
android:exported="true" | |||
android:label="@string/app_name" | |||
android:windowSoftInputMode="adjustResize" |
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.
굿굿 고생하셨어요 ㅜㅜ
shape = RoundedCornerShape(16.dp) | ||
) | ||
.padding(horizontal = 12.dp, vertical = 8.dp) | ||
.widthIn(max = 230.dp) |
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.
우왕 저도 안써봤는데 좋네요!!
.fillMaxWidth() | ||
.padding(horizontal = 16.dp, vertical = 8.dp), | ||
verticalAlignment = Alignment.Bottom, | ||
horizontalArrangement = if (isSentByOwner) Arrangement.End else Arrangement.Start |
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: Modifier = Modifier | ||
) { | ||
val isMessageTextFieldNotEmpty = text.isNotBlank() | ||
// val focusRequester = remember { FocusRequester()} |
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 messages = remember { | ||
mutableStateListOf( | ||
Triple("안녕하세요", true, "오후 12:00"), |
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.
트리플 아주 좋아요!
setInputText("") | ||
} | ||
}, | ||
modifier = Modifier.fillMaxWidth().imePadding() |
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.
imePadding 고생했어요 ㅜㅜㅜ
…ID-WITHSUHYEON into feat/#41-chat-view # Conflicts: # app/src/main/java/com/sopt/withsuhyeon/core/navigation/RouteModel.kt
Related issue 🛠
Work Description 📝
Screenshot 📸
ChatRoomScreen.mp4
Uncompleted Tasks 😅
To Reviewers 📢
채팅방 뷰 구현 완료하였습니다.
키보드 ime 문제 해결 때문에 PR이 늦어졌네요 ㅠㅠㅠㅠ 🥹
앞으로 남은 4일만 더 ! 화이팅