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 7c9c9a6..97601b1 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 @@ -27,7 +27,7 @@ class SignUpViewModel : ViewModel() { val isIdValid: LiveData = Transformations.map(idText) { checkIdValid(it) } val isPwValid: LiveData = Transformations.map(pwText) { checkPwValid(it) } - val buttonValid: MutableLiveData = MutableLiveData(false) + val isButtonValid: MutableLiveData = MutableLiveData(false) fun signUp(id: String, password: String, name: String, skill: String) { AuthServicePool.authService.signUp( @@ -66,7 +66,7 @@ class SignUpViewModel : ViewModel() { } fun setButtonState() { - buttonValid.value = + isButtonValid.value = (isIdValid.value == true && isPwValid.value == true && idText.value!!.isNotBlank() && pwText.value!!.isNotBlank()) } diff --git a/app/src/main/res/layout/activity_sign_up.xml b/app/src/main/res/layout/activity_sign_up.xml index c0badf8..0ba2c7a 100644 --- a/app/src/main/res/layout/activity_sign_up.xml +++ b/app/src/main/res/layout/activity_sign_up.xml @@ -178,8 +178,7 @@ android:layout_height="wrap_content" android:layout_marginHorizontal="30dp" android:layout_marginVertical="20dp" - android:enabled="@{vm.buttonValid}" - android:onClick="" + android:enabled="@{vm.isButtonValid}" android:paddingVertical="10dp" android:text="@string/btn_login_sign_up" android:textSize="15sp"