diff --git a/app/src/main/java/org/android/go/sopt/presentation/auth/SignUpViewModel.kt b/app/src/main/java/org/android/go/sopt/presentation/auth/SignUpViewModel.kt index 4405952..47cb727 100644 --- a/app/src/main/java/org/android/go/sopt/presentation/auth/SignUpViewModel.kt +++ b/app/src/main/java/org/android/go/sopt/presentation/auth/SignUpViewModel.kt @@ -24,8 +24,12 @@ class SignUpViewModel : ViewModel() { val nameText: MutableLiveData = MutableLiveData("") val skillText: MutableLiveData = MutableLiveData("") - val isIdValid: LiveData = Transformations.map(idText) { checkIdValid(it) } - val isPwValid: LiveData = Transformations.map(pwText) { checkPwValid(it) } + val isIdValid: LiveData = Transformations.map(idText) { id -> + checkIdValid(id) + } + val isPwValid: LiveData = Transformations.map(pwText) { pw -> + checkPwValid(pw) + } val isButtonValid: MutableLiveData = MutableLiveData(false) @@ -71,7 +75,7 @@ class SignUpViewModel : ViewModel() { } companion object { - const val ID_PATTERN = """^(?=.*[a-zA-Z])(?=.*\d).{6,10}$""" - const val PW_PATTERN = """^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()?]).{6,12}$""" + private const val ID_PATTERN = """^(?=.*[a-zA-Z])(?=.*\d).{6,10}$""" + private const val PW_PATTERN = """^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()?]).{6,12}$""" } } \ No newline at end of file