Skip to content

Commit

Permalink
Refactor: 비밀번호, 재입력 확인 로직 수정 / 회원가입 진행폼 작업 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
CHOI97 committed May 6, 2023
1 parent 0ae272c commit bf12607
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ class SignupProfileFragment : BaseFragment<FragmentSignupProfileBinding>(
signupViewModel.setSignupProgress(100)
signupViewModel.nickname.observe(viewLifecycleOwner, Observer {
checkEmpty()
Log.d("nick","Observe")
})
signupViewModel.comment.observe(viewLifecycleOwner, Observer {
checkEmpty()
Log.d("comment","Observe")
})

binding.btnSignupProfileNext.setOnClickListener{
Navigation.findNavController(view)
.navigate(R.id.action_signupProfileFragment_to_signupFinFragment)
}
getResult =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == REQUEST_CODE_FOR_INTENT) {
Expand All @@ -74,8 +76,5 @@ class SignupProfileFragment : BaseFragment<FragmentSignupProfileBinding>(
private fun checkEmpty(){
binding.btnSignupProfileNext.isEnabled = signupViewModel.profileEmptyCheck()
binding.btnSignupProfileNext.isClickable = signupViewModel.profileEmptyCheck()

Log.d("next Enabled", binding.btnSignupProfileNext.isEnabled.toString())
Log.d("next Enabled", binding.btnSignupProfileNext.isClickable.toString())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,24 @@ class SignupPwFragment: BaseFragment<FragmentSignupPwBinding>(R.layout.fragment_
binding.signupViewModel = signupViewModel
signupViewModel.setSignupProgress(75)
signupViewModel.pw.observe(viewLifecycleOwner,Observer{
Log.d("pw","Observe")
pwEmpty()
})
signupViewModel.rePw.observe(viewLifecycleOwner,Observer{
pwEmpty()
Log.d("repw","Observe")
})
binding.btnSignupNextPw.setOnClickListener {
Navigation.findNavController(view)
.navigate(R.id.action_signupPwFragment_to_signupProfileFragment)
if(checkEqualPassword()){
Navigation.findNavController(view)
.navigate(R.id.action_signupPwFragment_to_signupProfileFragment)
}else{
binding.tilRePwSignupInput.error = "입력하신 비밀번호와 일치하지 않습니다."
}
}
}
private fun checkEqualPassword(): Boolean {
return signupViewModel.matchPwCheck()
}

private fun pwEmpty(){
binding.btnSignupNextPw.isEnabled = signupViewModel.pwEmptyCheck()
binding.btnSignupNextPw.isClickable = signupViewModel.pwEmptyCheck()
Expand Down

0 comments on commit bf12607

Please sign in to comment.