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] 장소 검색 API 연동 #106

Merged
merged 20 commits into from
Jan 11, 2024
Merged

[feat] 장소 검색 API 연동 #106

merged 20 commits into from
Jan 11, 2024

Conversation

HAJIEUN02
Copy link
Collaborator

@HAJIEUN02 HAJIEUN02 commented Jan 11, 2024

Related issue 🛠

Work Description ✏️

  • Request Header에 accessToken 추가
  • 클린 아키텍처, DI 적용
  • 리사이클러뷰 각 아이템에 GET해온 값 추가
  • 단일선택 로직 추가
  • 엠티뷰, 검색결과뷰 visibility 설정

Screenshot 📸

XRecorder_11012024_215013.mp4

Uncompleted Tasks 😅

N/A

To Reviewers 📢

우헤헤^!^

Copy link
Collaborator

@jihyunniiii jihyunniiii 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 29 to 30
val keyHash = Utility.getKeyHash(this)
Timber.tag("KeyHash").d(keyHash)
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거 다시 주석 처리 해주세용

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 Author

Choose a reason for hiding this comment

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

지현언니만 안했티비 ㅋㅋ

Copy link
Member

@Doreminwoo Doreminwoo left a comment

Choose a reason for hiding this comment

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

역시 지은님~~~ 잘 보고 따라하겠습니다!!

planLocationViewModel.planLocationListState.flowWithLifecycle(lifecycle).onEach { uiState ->
when (uiState) {
is UiState.Success -> {
binding.rvPlanLocationList.adapter = planLocationAdapter
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 Author

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 69
with(binding) {
rvPlanLocationList.visibility = View.VISIBLE
layoutPlanLocationEmpty.visibility = View.INVISIBLE
}
}

is UiState.Empty -> {
with(binding) {
rvPlanLocationList.visibility = View.INVISIBLE
layoutPlanLocationEmpty.visibility = View.VISIBLE
Copy link
Member

Choose a reason for hiding this comment

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

with 스코프함수를 두개 연속으로 사용하기 보다는 상위에서 한번만 사용하는게 좋을 것 같습니다

Copy link
Collaborator

Choose a reason for hiding this comment

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

와 미쳤다 스코프 함수 장인이시네염

Copy link
Collaborator Author

@HAJIEUN02 HAJIEUN02 Jan 11, 2024

Choose a reason for hiding this comment

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

반영해서 수정하려고 했는데.. 걔를 최상단에 하니까 비지블 처리가 제대로 안돼요 ㅜㅜ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

위에서 리사이클러뷰 비지블 처리 지워버리니까 엠티뷰->검색뷰로 안 넘어가서 다시 추가했슴당;;ㅜ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

완 ㅋㅋ

Comment on lines +140 to +148
when (planLocationList.isEmpty()) {
true -> {
_planLocationListState.emit(UiState.Empty)
}

false -> {
_planLocationList.value = planLocationList
_planLocationListState.emit(UiState.Success(planLocationList))
}
Copy link
Member

Choose a reason for hiding this comment

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

개인적인 생각으로 조건문이 Boolean이라면 when문 보다는 if else로 하는 것이 더 깔끔할 것 같다는 생각이 들어요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

저는 코틀린에만 when이 있어서 이걸 쓰구 싶음여 ㅋ

planLocationAdapter.currentList

with(binding) {
rvPlanLocationList.visibility = View.VISIBLE
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.

호호

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

후후.. 수정했습니다! 리사이클러뷰가 띄워졌다가 다시 empty뷰로 띄워줘야 하는 경우에는 invisible로 다시 바꿔줘야 해서 하나만 수정했슴요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅋㅋ 완

# Conflicts:
#	app/src/main/java/org/sopt/pingle/di/DataSourceModule.kt
#	app/src/main/java/org/sopt/pingle/di/RepositoryModule.kt
#	app/src/main/java/org/sopt/pingle/di/ServiceModule.kt
#	app/src/main/java/org/sopt/pingle/di/UseCaseModule.kt
#	app/src/main/java/org/sopt/pingle/presentation/ui/auth/AuthActivity.kt
when (uiState) {
is UiState.Success -> {
planLocationAdapter.submitList(uiState.data)
planLocationAdapter.currentList
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거 왜 썼나염??

@HAJIEUN02 HAJIEUN02 merged commit a509929 into develop Jan 11, 2024
1 check passed
@HAJIEUN02 HAJIEUN02 deleted the feat-plan-location-api branch January 12, 2024 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feat] 장소 검색 API 연동
3 participants