Skip to content

Commit

Permalink
[CHORE/#13] 중복 내용 함수화 진행
Browse files Browse the repository at this point in the history
  • Loading branch information
chattymin committed Jan 1, 2024
1 parent f6d6187 commit 32fc59f
Showing 1 changed file with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,22 @@ class OnboardingProfileSettingActivity :

private fun initSetOnFucusChangeListener() {
binding.etOnboardingProfileSettingName.setOnFocusChangeListener { _, hasFocus ->
if (hasFocus) {
setNameCounterColor(R.color.gray_700)
} else {
setNameCounterColor(R.color.gray_200)
}
if (viewModel.isNameAvailable.value == NameState.Blank) {
setNameCounterColor(R.color.red_400)
}
judgeCounterColorWithFocus(hasFocus)
}

binding.etOnboardingProfileSettingInfo.setOnFocusChangeListener { _, hasFocus ->
if (hasFocus) {
setNameCounterColor(R.color.gray_700)
} else {
setNameCounterColor(R.color.gray_200)
}
if (viewModel.isNameAvailable.value == NameState.Blank) {
setNameCounterColor(R.color.red_400)
}
judgeCounterColorWithFocus(hasFocus)
}
}

private fun judgeCounterColorWithFocus(hasFocus: Boolean) {
if (hasFocus) {
setNameCounterColor(R.color.gray_700)
} else {
setNameCounterColor(R.color.gray_200)
}
if (viewModel.isNameAvailable.value == NameState.Blank) {
setNameCounterColor(R.color.red_400)
}
}

Expand Down

0 comments on commit 32fc59f

Please sign in to comment.