-
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] 마이페이지 / 유저 정보 조회 서버 연결 및 기능 구현 #245
Conversation
간단한 text인데 각각 스타일이 모두 달라 textView 여러개로 분리했었는데, bindingAdapter에 spannableString 을 도입해 하나의 textView로 관리하는 방향으로 구현했다
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.
중복되는 코드를 줄이기 위해 바인딩 어댑터를 많이 활용하신 거 같네요! 고생하셨습니다! 👍
//navigateToUpload() | ||
} | ||
} | ||
|
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.
우리의 목표 바텀시트 . . 😭
@@ -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() | |||
} |
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 navigateToMyFeedScreen() { | ||
Intent(requireContext(), MyFeedActivity::class.java).apply { | ||
startActivity(this) | ||
} |
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.
내부에서 예외를 던지는 requireContext()에 대해 어떻게 생각하시는지요!
nullable 타입 반환이 나을까요, 아님 지금 방식대로 가는 게 좋을까요??
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.
일단 러넥트는 nullable하게 반환하는 방향으로 변경했으니 위니는 그대로 유지해보는 거 어떨까요 ? requireContext()를 사용했을때 null일 경우 ISE가 발생하는 상황이 실제로 발생할 경우가 있는지 직접 경험하고 필요성을 느껴보고 싶기도해서요 + ) parentFragmentManager도 마찬가지 !
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.
넵 좋습니다!!
|
||
@BindingAdapter("setMyPageLevelResource", "imageViewId") | ||
fun ImageView.setMyPageLevelResource(userLevel: String?, imageViewId: String) { | ||
userLevel?.let { userLevel -> |
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.
유저 레벨이 nullable 타입인 이유가 있나요??
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.
getUser API 가 다음과 같이 응답이 nullable하게 오도록 구현했기 때문에
override suspend fun getUser(): Result<UserV2?>
response가 null인 경우 그 값 중 하나인 userLevel을 받아서 활용한 바인딩 어댑터 또한 nullable 해야 안전하다고 생각했는데 어떻게 생각하시나요 ? 리뷰 보고 살펴보니 제가 구현해놓고도 아래의 바인딩 어댑터는 nullable 하지 않게 해두었네요 😅
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.
음.. 바인딩 어댑터는 주로 UI 관련 작업을 하기 때문에 데이터가 널인 경우에 대한 처리는 뷰모델 쪽에서 하는 것이 더 좋은 방향이지 않을까 생각합니다!
.append(money) | ||
.append(amount) | ||
.append(measurement) | ||
|
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.
한 줄에 들어갈 간단한 텍스트뷰인데 스타일이 다르다는 이유로 뷰도 세개, 바인딩 어댑터도 세개 만들어야 한다는 점이 불편한 것 같아 찾아보다가 발견했어요 ㅎㅎㅎ 이 글 참고해서 구현했습니다!
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.
생각보다 디테일하게 신경쓸 게 참 많은 화면이었군요!! 고생했어요 👍
📝 Work Description
📸 Screenshot
Screen_Recording_20240220-131350_Winey.mp4
📣 To Reviewers