Skip to content

6주차 필수,심화#20

Open
l2zh wants to merge 5 commits intodevelopfrom
6주차-필수,심화

Hidden character warning

The head ref may contain hidden characters: "6\uc8fc\ucc28-\ud544\uc218,\uc2ec\ud654"
Open

6주차 필수,심화#20
l2zh wants to merge 5 commits intodevelopfrom
6주차-필수,심화

Conversation

@l2zh
Copy link
Copy Markdown
Contributor

@l2zh l2zh commented Dec 1, 2023

📌 관련 이슈

📷 screenshot

6.mp4

📝 Work Desciption

  • 양방향 데이터 바인딩 적용 (경고문구)
  • 바인딩 어댑터 적용 (닉네임 공란 경고 문구)

📚 Reference 혹은 궁금한 사항들

필수랑 심화를 분리하기 애매해서 한번에 올립니다...!
데이터 바인딩 안쓰고 있었는데 역시 편하네요... 앱잼때는 써야겠습니다
MediatorLiveData 확장함수 최고네요

@l2zh l2zh requested review from a team and haeti-dev December 1, 2023 08:01
@l2zh l2zh self-assigned this Dec 1, 2023
Copy link
Copy Markdown

@jihyunniiii jihyunniiii left a comment

Choose a reason for hiding this comment

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

이준희 그만 잘해 질투나 ㅋㅋ

showSnackbar(binding.root, getString(R.string.signup_error_message))
}
signUpViewModel.signUp()
observeSignUp()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

observeSignUp 함수만 onCreate에서 실행시켜주지 않은 이유가 있나염?? 걍 진짜 궁금합니당

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

버튼이 조건에 안맞으면 항상 비활성화 상태라 여기다 두었는데 그냥 onCreate에 두는게 더 명확해 보이네요! 감삼다~

Comment on lines +30 to +32
val isEnabledLoginButton = MediatorLiveData<Boolean>().apply {
addSourceList(id, pw, nickname, mbti) { isValidSignUpInfo() }
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이 확장함수 진짜 짱이네염 배워갑니둥,,,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

편안해지죠

@l2zh l2zh requested review from HAJIEUN02 and pump9918 December 8, 2023 09:02
Copy link
Copy Markdown

@pump9918 pump9918 left a comment

Choose a reason for hiding this comment

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

나도 이렇게 코드 잘짜고 싶다... 고생많았어유

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

이 파일은 어떤 역할을 하는건가요?? 이해가 어렵...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

MediatorLiveData에 대한 확장함수 입니다!
궁금하면 안드 확장함수 모음집에 남겨뒀으니 보고 적용해봐도 좋을것 같네요!

}

private fun observePw() {
signUpViewModel.pw.observe(this) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

observe가 상태변화가 있을 만한 곳에 넣는 거 맞나요? 어떤 기준으로 observe를 쓰는지 궁금합니당

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

상태변화가 있을 만한 곳이라기 보다는 상태변화 감지가 필요한 곳이 맞는것 같습니다!

이 경우에는 pw가 비밀번호 입력에 대한 LiveData이므로 상태가 변화할 때 마다 감지되어서
비밀번호 입력 조건에 부합한지 확인 후에 오류메세지의 visible처리를 해야되므로 필요하죠!

여기도 함수 분리가 필요해 보이긴 하는데 귀찮음 이슈로 패스....

Copy link
Copy Markdown

@HAJIEUN02 HAJIEUN02 left a comment

Choose a reason for hiding this comment

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

멋있습니당,, 나두 언어 하나라도 잘 쓰고 코드도 깔끔깔쌈하게 짤 줄 아는 사람이 되고 싶다!!!!!! 고생하셨어욤~~

private fun isValidateId(id: String): Boolean {
return id.isNotBlank() && ID_REGEX.matcher(id).matches()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

왕 근데 새삼,, 삭제된 함수들도 진짜 간결하구 야무지네요.... 삭제됐지만 배워야겠는데여


object BindingAdapter {
@JvmStatic
@BindingAdapter("setSignupZeroErrorTextVisible")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

요런식으루 작성하는 건 먼가요?! Adapter를 Binding하는데 이런식으로 쓰는 건가요?? 아님 어댑터 안의 어떤 요소를 바인딩하는 것인지.. 아니면 어댑터에 끼워줄 애를 이렇게 넣는 것인지..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants