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/setting #30

Merged
merged 10 commits into from
Jan 21, 2023
Merged

Feat/setting #30

merged 10 commits into from
Jan 21, 2023

Conversation

eunjjungg
Copy link
Owner

PR TITLE : Feat/setting

관련 Issue : #26


PR 작업사항

  • 만들어둔 뷰 재사용
  • 피그마 - 프로필 수정 1
  • 피그마 - 프로필 수정 2
  • 서버 연동 연동 완료

@eunjjungg eunjjungg added the enhancement New feature or request label Jan 21, 2023
@eunjjungg eunjjungg self-assigned this Jan 21, 2023
@eunjjungg eunjjungg closed this Jan 21, 2023
@eunjjungg eunjjungg reopened this Jan 21, 2023
@eunjjungg eunjjungg changed the base branch from master to develop January 21, 2023 21:14
@eunjjungg eunjjungg merged commit b8fe068 into develop Jan 21, 2023
@eunjjungg eunjjungg deleted the feat/setting branch January 21, 2023 21:19
Copy link
Owner Author

@eunjjungg eunjjungg left a comment

Choose a reason for hiding this comment

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

23.01.22 자아성찰 리뷰 완료

@@ -46,7 +46,9 @@ class InterestButton : ConstraintLayout {
true -> binding.iconBg.background.setTint(ContextCompat.getColor(context, R.color.icon_bg_selected))
else -> binding.iconBg.background.setTint(ContextCompat.getColor(context, R.color.icon_bg_unSelected))
}
listener?.interestButtonOnClick(binding.description.text.toString(), interestIsSelected)
if (this::listener.isInitialized) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

lateinit인 경우 null check

BaseActivity<ActivitySettingUserInfoBinding>(R.layout.activity_setting_user_info) {
override val viewModel by viewModels<SettingUserInfoViewModel> {
SettingUserInfoViewModel.SettingUserInfoViewModelFactory(
SettingRepository.getInstance()!!
Copy link
Owner Author

Choose a reason for hiding this comment

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

내 코드에서 !! 연산자 유일하게 쓰는 부분.. 이거 어ㄸ멓게 하고 싶다 ㅠ 👎


override fun onCreateAction() {
//ViewCompat.setTransitionName(binding.tvPageName, "pageName")
initData()
Copy link
Owner Author

Choose a reason for hiding this comment

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

서버로부터 데이터 받아오는 함수인데 명명 잘못한 것 같음.


private fun initData() {
viewModel.getInitData(
initInterest = { initInterestButton(it) },
Copy link
Owner Author

Choose a reason for hiding this comment

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

코틀린에서 일반 함수를 람다로 사용하는 방법..! 멍청하게도 까먹고 있다가 저날 생각함 8ㅅ8

}
}

private fun makeSnackBar(message: String) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

여기저기서 다 쓸거면 유틸로 빼는 것도..

}

private fun initPurposeDropDown(purpose: String) {
binding.dropdownPurpose.setText(purpose, false)
Copy link
Owner Author

Choose a reason for hiding this comment

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

AutoCompleteTextView에서 기본값 세팅해서 올리는 방법

}
if (isClicked) {
when (title) {
GENDER.Male.text -> {
Copy link
Owner Author

Choose a reason for hiding this comment

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

귀찮아서 만들어놓은 것 재사용하긴 했지만 진짜 마음에 안 드는 부분... 애초에 커스텀 뷰를 만들어놓은걸 레이아웃화해서 각 버튼들이 배타적으로 눌리게 구현했다면 이 긴 코드가 회원가입, 설정 각각 써줄 필요가 없었는데.. 결국 일을 두 번 했다. 👎

}
}
} else {
val setNull: (GENDER) -> Unit = {
Copy link
Owner Author

Choose a reason for hiding this comment

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

한 번 더 눌려서 취소된 항목이 뷰모델의 gender 값과 일치하면 널로 하게 해준 것 같은데.. 과거의 나는 왜 이런 코드를...

}

fun interestSelected(title: String, isClicked: Boolean) {
val settingList : (SignUpViewModel.INTEREST) -> Unit = { interest ->
Copy link
Owner Author

Choose a reason for hiding this comment

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

이것도.. 더 좋은 방법이 있을 것이다.. 👎
enum 항목들이 각각 체크되었는지 확인하는 과정이 필요한데 난 그걸 enum 자체를 배열에 넣었고 추가되면 add, 제거 되면 remove .. 근데 더 좋은 방법이 있지 않을까?

@@ -0,0 +1,286 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Owner Author

Choose a reason for hiding this comment

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

싹 다 레이아웃화 해뒀으면 이럴 일 없는데... 🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬 왜 이렇게 재사용하기 어렵게 짜뒀을까..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant