Skip to content
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

Merged
merged 24 commits into from
Jan 22, 2025
Merged

[FEAT/#41] 채팅방 뷰 구현 #49

merged 24 commits into from
Jan 22, 2025

Conversation

yskim6772
Copy link
Collaborator

Related issue 🛠

Work Description 📝

  • 채팅방 뷰 구현
  • 키보드 ime 문제 해결

Screenshot 📸

ChatRoomScreen.mp4

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

채팅방 뷰 구현 완료하였습니다.
키보드 ime 문제 해결 때문에 PR이 늦어졌네요 ㅠㅠㅠㅠ 🥹
앞으로 남은 4일만 더 ! 화이팅

…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
@yskim6772 yskim6772 added ⭐ [FEAT] 새로운 기능 구현 💙 [UI] UI 작업 🔧 [FIX] 버그 및 오류 해결 🌻 윤서 yskim6772 labels Jan 20, 2025
@yskim6772 yskim6772 self-assigned this Jan 20, 2025
…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
Copy link
Member

@sayyyho sayyyho left a comment

Choose a reason for hiding this comment

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

채팅방 뷰까지 구현하다니... 레전드 리드!!! 조금만 더 화이팅!!

Comment on lines 103 to 116
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)
}
}
Copy link
Member

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
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

이건 처음보네요! 써먹어야지!

Copy link
Collaborator

Choose a reason for hiding this comment

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

우왕 저도 안써봤는데 좋네요!!

Comment on lines 66 to 73
textFieldBorderColor
?: when {
value.isNotEmpty() && !isValid -> colors.Red01
isMaxLengthExceeded -> colors.Red01
isFocused -> colors.Purple300
!isValid -> colors.Red01
else -> colors.Grey100
}
Copy link
Member

Choose a reason for hiding this comment

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

애증의 텍스트필드...

Comment on lines 27 to 47
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)
}

Copy link
Member

Choose a reason for hiding this comment

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

레전드 확장함수 고생했어요!

Comment on lines +60 to +66
val lazyListState = rememberLazyListState()

LaunchedEffect(messages.size) {
if (messages.isNotEmpty()) {
lazyListState.animateScrollToItem(messages.size - 1)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

굿

Copy link
Collaborator

@serioushyeon serioushyeon left a comment

Choose a reason for hiding this comment

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

굿굿!!! 뷰 너무 잘 구현해주셨어요 트슛까지 끈기있게 해내서 너무 멋있다...ㅜ 고생하셨어요!

@@ -25,6 +25,7 @@
android:name=".feature.main.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize"
Copy link
Collaborator

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)
Copy link
Collaborator

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
Copy link
Collaborator

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()}
Copy link
Collaborator

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"),
Copy link
Collaborator

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()
Copy link
Collaborator

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
@yskim6772 yskim6772 merged commit 95d51e6 into develop Jan 22, 2025
@yskim6772 yskim6772 deleted the feat/#41-chat-view branch January 22, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ [FEAT] 새로운 기능 구현 🌻 윤서 yskim6772 🔧 [FIX] 버그 및 오류 해결 💙 [UI] UI 작업
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 채팅방 뷰 구현
3 participants