Skip to content

Commit

Permalink
[fix] #144 Fix Error & View Ver 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-j0y committed May 20, 2022
1 parent 602c646 commit 36a8686
Show file tree
Hide file tree
Showing 10 changed files with 655 additions and 470 deletions.
17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ android {
applicationId "com.infra.infraandroid"
minSdk 23
targetSdk 31
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"
buildConfigField("String", "WEB_CLIENT_ID", '"953936170275-n0h7o7932npcdaa9n0e97ihuruugspeg.apps.googleusercontent.com"')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ data class RequestUserData(
@SerializedName("user_phone")
var userPhone : String,
@SerializedName("user_email")
var userEmail : String
var userEmail : String,
@SerializedName("user_nickname")
var userNickName : String
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.infra.infraandroid.id.view

import android.content.Context
import android.os.Bundle
import android.text.Editable
import android.text.InputType
Expand All @@ -8,11 +9,13 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.widget.AppCompatButton
import androidx.core.content.ContextCompat.getSystemService
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
Expand Down Expand Up @@ -64,6 +67,7 @@ class SignUpFirstFragment : Fragment() {
val goToSecondSignUpButton = mBinding?.goToSecondSignUpButton as AppCompatButton
val doNotUseThisIdTextView = mBinding?.doNotUseThisIdTextView as TextView


// 아이디 생성 유효성 검사 및 정규식
inputMakeIdEdittext.addTextChangedListener(object: TextWatcher{
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.infra.infraandroid.id.view

import android.os.Bundle
import android.telephony.PhoneNumberFormattingTextWatcher
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
Expand Down Expand Up @@ -63,6 +64,7 @@ class SignUpSecondFragment : Fragment(){
val retryTextView = mBinding?.reInputCodeTextView as TextView
val certifyImageView = mBinding?.certifyCodeImageView as ImageView

inputPhoneNumberEditText.addTextChangedListener(PhoneNumberFormattingTextWatcher())

// 전화번호 유효성 검사, 정규식 표현
inputPhoneNumberEditText.addTextChangedListener(object : TextWatcher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.view.ViewGroup
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.widget.AppCompatButton
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.findNavController
Expand All @@ -21,9 +22,12 @@ import com.infra.infraandroid.id.model.RequestUserData
import com.infra.infraandroid.id.model.ResponseUserData
import com.infra.infraandroid.util.ServiceCreator
import com.infra.infraandroid.id.viewmodel.SignUpViewModel
import com.infra.infraandroid.myinfo.myinfomodify.model.RequestNicknameCheckData
import com.infra.infraandroid.myinfo.myinfomodify.model.ResponseNicknameCheckData
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import java.util.regex.Pattern


// 회원가입 third depth 페이지 (닉네임 설정)
Expand All @@ -35,6 +39,7 @@ import retrofit2.Response
class SignUpThirdFragment : Fragment(){
private var mBinding : FragmentSignUpThirdBinding? = null
private val sharedViewModel : SignUpViewModel by activityViewModels()
private var isChecked : Boolean = false

override fun onCreateView(
inflater: LayoutInflater,
Expand Down Expand Up @@ -62,13 +67,13 @@ class SignUpThirdFragment : Fragment(){

override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
if (Patterns.EMAIL_ADDRESS.matcher(email.text.toString()).matches()) {
nextButton.isEnabled = true
nextButton.isEnabled = isChecked
}
}

override fun afterTextChanged(p0: Editable?) {
if (Patterns.EMAIL_ADDRESS.matcher(email.text.toString()).matches()) {
nextButton.isEnabled = true
nextButton.isEnabled = isChecked
}
}
})
Expand All @@ -80,7 +85,8 @@ class SignUpThirdFragment : Fragment(){
userId = "",
userPw = "",
userPhone = "",
userEmail = ""
userEmail = "",
userNickName = ""
)
sharedViewModel.currentInputId.observe(viewLifecycleOwner) { currentInputId ->
requestUserData.userId = currentInputId
Expand All @@ -95,6 +101,8 @@ class SignUpThirdFragment : Fragment(){
requestUserData.userEmail = currentInputEmail
}

requestUserData.userNickName = mBinding?.inputNicknameEditText?.text.toString()

val call: Call<ResponseUserData> = ServiceCreator.signUpService
.postSignUp(requestUserData)

Expand Down Expand Up @@ -149,6 +157,62 @@ class SignUpThirdFragment : Fragment(){

})
}

mBinding?.inputNicknameEditText?.addTextChangedListener(object: TextWatcher{
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
mBinding?.checkButton?.isEnabled = false
}

override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
mBinding?.checkButton?.isEnabled = mBinding?.inputNicknameEditText?.text?.length!! in 2..6
}

override fun afterTextChanged(p0: Editable?) {
mBinding?.checkButton?.isEnabled = mBinding?.inputNicknameEditText?.text?.length!! in 2..6
}
})


mBinding?.checkButton?.setOnClickListener{
//닉네임 중복 서버 연결

val requestNicknameCheckData = RequestNicknameCheckData(
userNickname = mBinding?.inputNicknameEditText?.text.toString(),
)

val call: Call<ResponseNicknameCheckData> = ServiceCreator.nicknameDoubleCheckService
.doublecheck(requestNicknameCheckData)
call.enqueue(object : Callback<ResponseNicknameCheckData>{
override fun onResponse(
call: Call<ResponseNicknameCheckData>,
response: Response<ResponseNicknameCheckData>
) {
if(response.isSuccessful){
val data = response.body()?.code
if(data==1000) {
isChecked = true
mBinding?.doNotUseThisNickNameTextView?.isVisible = false
mBinding?.canUseIconImageView?.isVisible = true
mBinding?.inputNicknameEditText?.setBackgroundResource(R.drawable.can_use_this_id_background)
nextButton.isEnabled = true
}
if(data==3104){
mBinding?.doNotUseThisNickNameTextView?.isVisible = true
mBinding?.canUseIconImageView?.isVisible = false
mBinding?.inputNicknameEditText?.setBackgroundResource(R.drawable.double_check_id_background)
nextButton.isEnabled = false
}
}
}

override fun onFailure(call: Call<ResponseNicknameCheckData>, t: Throwable) {

}

})
}


}

override fun onDestroyView() {
Expand Down
Loading

0 comments on commit 36a8686

Please sign in to comment.