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] 마이페이지 / 유저 정보 조회 서버 연결 및 기능 구현 #245

Merged
merged 11 commits into from
Feb 21, 2024

Conversation

sxunea
Copy link
Contributor

@sxunea sxunea commented Feb 20, 2024

📝 Work Description

  • 금액별 단위 아이템 ui 작업
  • getUser 변경된 API 반영해 서버 연결
  • 마이피드 프래그먼트에서 액티비티로 이전
  • 목표 확인 카드 디자인 변경 반영

📸 Screenshot

Screen_Recording_20240220-131350_Winey.mp4

📣 To Reviewers

  • 목표 확인 카드는 API 수정 작업 기다려야해서 일단 뷰만 만들어 두었습니다 ! 이거 머지하고 기다리는 동안 설정 마무리할게요
  • 실행시켜보면 세이버 그림자에 닉네임이 위치해있는데 어제 말한 백그라운드 이미지 길이 부족이 그 이유라 이것도 디자인 리소스 나오면 함께 반영할 예정입니다

@sxunea sxunea added feat ✨ 새로운 기능 구현 혜선 🐱 labels Feb 20, 2024
@sxunea sxunea self-assigned this Feb 20, 2024
Copy link
Member

@leeeha leeeha left a comment

Choose a reason for hiding this comment

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

중복되는 코드를 줄이기 위해 바인딩 어댑터를 많이 활용하신 거 같네요! 고생하셨습니다! 👍

//navigateToUpload()
}
}

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
Contributor Author

Choose a reason for hiding this comment

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

우리의 목표 바텀시트 . . 😭

@@ -164,7 +187,7 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
if (receivedBundle != null) {
val value = receivedBundle.getBoolean(KEY_TO_MYFEED)
if (value) {
navigateAndBackStack<MyFeedFragment>()
navigateToMyFeedScreen()
arguments?.clear()
}
Copy link
Member

Choose a reason for hiding this comment

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

다시 보니까 네비게이션 코드가 상당히 복잡하고 헷갈리네요..! 배포 이후 리팩토링 해봐야겠다 💪

private fun navigateToMyFeedScreen() {
Intent(requireContext(), MyFeedActivity::class.java).apply {
startActivity(this)
}
Copy link
Member

Choose a reason for hiding this comment

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

내부에서 예외를 던지는 requireContext()에 대해 어떻게 생각하시는지요!
nullable 타입 반환이 나을까요, 아님 지금 방식대로 가는 게 좋을까요??

Copy link
Contributor Author

@sxunea sxunea Feb 20, 2024

Choose a reason for hiding this comment

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

일단 러넥트는 nullable하게 반환하는 방향으로 변경했으니 위니는 그대로 유지해보는 거 어떨까요 ? requireContext()를 사용했을때 null일 경우 ISE가 발생하는 상황이 실제로 발생할 경우가 있는지 직접 경험하고 필요성을 느껴보고 싶기도해서요 + ) parentFragmentManager도 마찬가지 !

Copy link
Member

Choose a reason for hiding this comment

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

넵 좋습니다!!


@BindingAdapter("setMyPageLevelResource", "imageViewId")
fun ImageView.setMyPageLevelResource(userLevel: String?, imageViewId: String) {
userLevel?.let { userLevel ->
Copy link
Member

Choose a reason for hiding this comment

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

유저 레벨이 nullable 타입인 이유가 있나요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getUser API 가 다음과 같이 응답이 nullable하게 오도록 구현했기 때문에

 override suspend fun getUser(): Result<UserV2?>

response가 null인 경우 그 값 중 하나인 userLevel을 받아서 활용한 바인딩 어댑터 또한 nullable 해야 안전하다고 생각했는데 어떻게 생각하시나요 ? 리뷰 보고 살펴보니 제가 구현해놓고도 아래의 바인딩 어댑터는 nullable 하지 않게 해두었네요 😅

Copy link
Member

Choose a reason for hiding this comment

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

음.. 바인딩 어댑터는 주로 UI 관련 작업을 하기 때문에 데이터가 널인 경우에 대한 처리는 뷰모델 쪽에서 하는 것이 더 좋은 방향이지 않을까 생각합니다!

.append(money)
.append(amount)
.append(measurement)

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
Contributor Author

Choose a reason for hiding this comment

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

한 줄에 들어갈 간단한 텍스트뷰인데 스타일이 다르다는 이유로 뷰도 세개, 바인딩 어댑터도 세개 만들어야 한다는 점이 불편한 것 같아 찾아보다가 발견했어요 ㅎㅎㅎ 이 글 참고해서 구현했습니다!

Copy link
Member

@leeeha leeeha Feb 20, 2024

Choose a reason for hiding this comment

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

생각보다 디테일하게 신경쓸 게 참 많은 화면이었군요!! 고생했어요 👍

@sxunea sxunea merged commit 97396d0 into develop Feb 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat ✨ 새로운 기능 구현 혜선 🐱
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feat] 마이페이지 / V2 서버 연결 및 기능 구현
2 participants