Skip to content

Commit

Permalink
[Chore/#82] 바인딩 묶기
Browse files Browse the repository at this point in the history
  • Loading branch information
yeoncheong committed Jul 19, 2023
1 parent 27c21a7 commit 37831a4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.act
layoutInputName.error = null
}
}

override fun afterTextChanged(p0: Editable?) {}
})
}
Expand All @@ -70,6 +71,7 @@ class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.act
layoutInputYear.error = null
}
}

override fun afterTextChanged(p0: Editable?) {}
})
}
Expand Down Expand Up @@ -98,16 +100,18 @@ class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.act
}

private fun saveInfo(user: User) {
user.name = binding.etName.text.toString()
user.gender =
if (binding.chip1.isChecked) {
binding.chip1.text.toString()
} else if (binding.chip2.isChecked){
binding.chip2.text.toString()
} else {
null
}
user.bornYear = binding.etYear.text.toString().toInt()
with(binding) {
user.name = etName.text.toString()
user.gender =
if (chip1.isChecked) {
chip1.text.toString()
} else if (chip2.isChecked) {
chip2.text.toString()
} else {
null
}
user.bornYear = etYear.text.toString().toInt()
}
}

private fun goSelectFamilyActivity() {
Expand All @@ -120,12 +124,18 @@ class InputInfoActivity : BindingActivity<ActivityInputInfoBinding>(R.layout.act
if (userData != null) {
saveInfo(userData)
if (!userData.isReceiver) { //초대하는 사람
Log.e("yeonjin", "inputInfo parcelable : ${userData?.isReceiver} + ${userData?.name} + ${userData?.gender} + ${userData?.bornYear}")
Log.e(
"yeonjin",
"inputInfo parcelable : ${userData?.isReceiver} + ${userData?.name} + ${userData?.gender} + ${userData?.bornYear}"
)
startActivity(Intent(this, SelectFamilyActivity::class.java).apply {
putExtra("userData", userData)
})
} else { //초대받는 사람
Log.e("yeonjin", "inputInfo parcelable : ${userData?.isReceiver} + ${userData?.name} + ${userData?.gender} + ${userData?.bornYear}")
Log.e(
"yeonjin",
"inputInfo parcelable : ${userData?.isReceiver} + ${userData?.name} + ${userData?.gender} + ${userData?.bornYear}"
)
startActivity(Intent(this, QuestActivity::class.java).apply {
putExtra("userData", userData)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ class SelectFamilyActivity :
}

private fun saveInfo(user: User) {
user.isInvitorChild = binding.chip1.isChecked
user.relationInfo =
if (binding.chip3.isChecked) {
binding.chip3.text.toString()
} else {
binding.chip4.text.toString()
}
with(binding) {
user.isInvitorChild = chip1.isChecked
user.relationInfo =
if (chip3.isChecked) {
chip3.text.toString()
} else {
chip4.text.toString()
}
}

}

private fun goQuestActivity() {
Expand Down

0 comments on commit 37831a4

Please sign in to comment.