-
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] 마이페이지 / 2주 절약, 낭비 기능 구현 #261
Conversation
…eks-animation # Conflicts: # app/src/main/java/org/go/sopt/winey/presentation/main/mypage/MyPageFragment.kt # app/src/main/java/org/go/sopt/winey/util/binding/BindingAdapter.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.
혹시 마이페이지 프래그먼트에서 목표 관련 체크박스가 4가지 경우로 케이스 분류되고 있나요??
- 금액 o, 횟수 o
- 금액 o, 횟수 x
- 금액 x, 횟수 o
- 금액 x, 횟수 x
저는 목표여정 화면에서 위의 4가지 경우에 따라 이미지 리소스를 바꾸는 식으로 구현했는데, 해당 기능 반영되어 있는지 궁금합니다!
@@ -44,6 +44,7 @@ class MainViewModel @Inject constructor( | |||
Timber.e("SUCCESS GET USER IN MAIN") | |||
dataStoreRepository.saveUserInfo(response) | |||
_getUserState.value = UiState.Success(response) | |||
_getUserState.value = UiState.Empty |
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.
Empty로 초기화 한 이유를 알 수 있을까요??
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()가 실행되면 UiState.Loading으로 지정되니 UiState.Empty로 다시 초기화 해주어서 마이 피드 삭제 후 getUserState가 Success 상태로 유지되어 관찰이 안되는 문제를 해결했습니다 ! 마이페이지에서 마이피드 삭제 후 finish() 했을 때 금액이 줄어들지 않는 문제를 해결하기 위해 도입했어요
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.
아하!! 이런 부분은 주석을 안 적어놓으면 나중에 코드 파악이 어렵더라구요..😂
// 상세피드 들어갔다 나올 때 성공 상태가 계속 관찰되어
// 이미 삭제된 항목이 되살아나는 일이 없도록 UiState 초기화
viewModel.initGetWineyFeedState()
// 상세피드 들어갔다 나올 때 성공 상태가 계속 관찰되어
// 스낵바가 반복해서 뜨지 않도록 UiState 초기화
viewModel.initDeleteFeedState()
그래서 저는 이렇게 위니피드 프래그먼트에 주석을 적어뒀습니다! 참고해서 반영하면 좋을 거 같아요!
} | ||
} | ||
} | ||
} |
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.
res/values 폴더 아래에 target_money.xml 파일 만들어서 int array 정의해뒀는데 해당 리소스 활용해도 좋을 거 같습니다!
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.
UserLevel도 presentation/model 패키지 아래에 이넘 클래스로 정의해뒀는데 활용하면 좋을 거 같습니다!
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 formatWithCommaForMoney(number: Int): String { |
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.
저는 이걸 확장함수로 만들어뒀는데 서로 방식이 통일되면 좋을 거 같습니다..! 🙏
} | ||
textView.text = spannableString | ||
} | ||
|
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.
전반적으로 매직넘버, 매직 리터럴이 많은데 상수화 또는 리소스화 시킬 수 있는 게 있다면, 나중에 확장성을 위해 리팩토링 하면 좋을 거 같습니다!
"CHICKEN" -> "30만원 x " | ||
"CHICKEN" -> "3만원 x " | ||
"SNEAKERS" -> "15만원 x " | ||
"AIRPODS" -> "30만원 x " | ||
else -> "" |
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.
어쩐지 치킨이 30만원이더라 ㅋㅋㅋㅋ 저도 앞으로 pr 더 꼼꼼히 확인할게요 😘
…eks-animation # Conflicts: # app/src/main/java/org/go/sopt/winey/data/model/remote/response/ResponseGetUserDto.kt # app/src/main/java/org/go/sopt/winey/data/repository/DataStoreRepositoryImpl.kt # app/src/main/java/org/go/sopt/winey/domain/entity/UserV2.kt # app/src/main/java/org/go/sopt/winey/presentation/main/mypage/MyPageFragment.kt
…eks-animation # Conflicts: # app/src/main/java/org/go/sopt/winey/presentation/main/mypage/MyPageFragment.kt
📝 Work Description
📸 Screenshot
📣 To Reviewers