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/#16 생년월일 입력 화면 #39

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

posite
Copy link
Member

@posite posite commented Nov 9, 2023

🧨이슈

🔍 상세 내용 (해결 내용)

  • 생년월일 입력 화면 개발

💡 참고자료 및 공유할만한 자료 (선택)

❕후속 진행 이슈

@posite posite added the 로그인 + 가입 로그인 + 가입 화면 개발 라벨 label Nov 9, 2023
@posite posite self-assigned this Nov 9, 2023
Copy link
Member

@JJJoonngg JJJoonngg left a comment

Choose a reason for hiding this comment

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

같은 패턴의 함수들이 보이네요
단순 view 이벤트 처리들은 view 에서 직접해결하도록 하고
viewmodel 이 필요 없다면 굳이 구현하지 않아도 됩니다.

databinding -> viewbinding 으로 넘어가는 추세이기에
databinding은 지양해줘요~!

private val _btnNext: SingleLiveEvent<Unit> = SingleLiveEvent()
val btnNext: LiveData<Unit> = _btnNext

fun onClickCheckButton() {
Copy link
Member

Choose a reason for hiding this comment

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

단순 button click 이벤트들은 databinding 을 지양하고
fragment에서 활용해주면 됩니다.
또한 observer 도 없네요~!

initTextWatcher()
}

override fun initObserver() {
Copy link
Member

Choose a reason for hiding this comment

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

with()을 사용할 땐

override fun initObserver) = with(viewModel){
.......
}

이렇게 사용하면 코드 줄 수도 줄어들고 불필요한 괄호도 사라집니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

넵! 바로 반영하겠습니다!

binding.birthdateEt.setSelection(binding.birthdateEt.text.length)

}else if(textlength == 8 && binding.birthdateEt.text.toString().substring(7,8) != "-" &&
!binding.birthdateEt.text.toString().substring(0,4).contains('-') &&
Copy link
Member

Choose a reason for hiding this comment

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

! 보단 뒤에 .not()을 사용하면 가독이 오르고
또한 각 숫자들이 의미하는 바가 뭔지 알기 어렵습니다.
매직넘버들은 상수화 해줘요~!

Copy link
Member Author

Choose a reason for hiding this comment

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

오옹! 그렇군요! 바로 수정하겠습니다!

}

override fun afterTextChanged(s: Editable?) {
}
Copy link
Member

Choose a reason for hiding this comment

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

비어있는 함수들은 = Unit 처리해주면 좋습니다.

val _birthDate: MutableLiveData<String> = MutableLiveData("")
val birthDate: LiveData<String> = _birthDate

fun onClickCheckButton() {
Copy link
Member

Choose a reason for hiding this comment

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

여기도 이벤트 그냥 activity, fragment 에서 하도록 해줘요~!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
로그인 + 가입 로그인 + 가입 화면 개발 라벨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants