-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/setting #30
Conversation
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.
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) { |
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.
lateinit인 경우 null check
BaseActivity<ActivitySettingUserInfoBinding>(R.layout.activity_setting_user_info) { | ||
override val viewModel by viewModels<SettingUserInfoViewModel> { | ||
SettingUserInfoViewModel.SettingUserInfoViewModelFactory( | ||
SettingRepository.getInstance()!! |
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.
내 코드에서 !!
연산자 유일하게 쓰는 부분.. 이거 어ㄸ멓게 하고 싶다 ㅠ 👎
|
||
override fun onCreateAction() { | ||
//ViewCompat.setTransitionName(binding.tvPageName, "pageName") | ||
initData() |
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 initData() { | ||
viewModel.getInitData( | ||
initInterest = { initInterestButton(it) }, |
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.
코틀린에서 일반 함수를 람다로 사용하는 방법..! 멍청하게도 까먹고 있다가 저날 생각함 8ㅅ8
} | ||
} | ||
|
||
private fun makeSnackBar(message: 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.
여기저기서 다 쓸거면 유틸로 빼는 것도..
} | ||
|
||
private fun initPurposeDropDown(purpose: String) { | ||
binding.dropdownPurpose.setText(purpose, false) |
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.
AutoCompleteTextView
에서 기본값 세팅해서 올리는 방법
} | ||
if (isClicked) { | ||
when (title) { | ||
GENDER.Male.text -> { |
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.
귀찮아서 만들어놓은 것 재사용하긴 했지만 진짜 마음에 안 드는 부분... 애초에 커스텀 뷰를 만들어놓은걸 레이아웃화해서 각 버튼들이 배타적으로 눌리게 구현했다면 이 긴 코드가 회원가입, 설정 각각 써줄 필요가 없었는데.. 결국 일을 두 번 했다. 👎
} | ||
} | ||
} else { | ||
val setNull: (GENDER) -> Unit = { |
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.
한 번 더 눌려서 취소된 항목이 뷰모델의 gender
값과 일치하면 널로 하게 해준 것 같은데.. 과거의 나는 왜 이런 코드를...
} | ||
|
||
fun interestSelected(title: String, isClicked: Boolean) { | ||
val settingList : (SignUpViewModel.INTEREST) -> Unit = { interest -> |
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.
이것도.. 더 좋은 방법이 있을 것이다.. 👎
enum
항목들이 각각 체크되었는지 확인하는 과정이 필요한데 난 그걸 enum
자체를 배열에 넣었고 추가되면 add
, 제거 되면 remove
.. 근데 더 좋은 방법이 있지 않을까?
@@ -0,0 +1,286 @@ | |||
<?xml version="1.0" encoding="utf-8"?> |
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.
싹 다 레이아웃화 해뒀으면 이럴 일 없는데... 🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬 왜 이렇게 재사용하기 어렵게 짜뒀을까..
PR TITLE : Feat/setting
관련 Issue : #26
PR 작업사항