diff --git a/app/src/main/java/com/example/infraandroid/id/view/LoginFragment.kt b/app/src/main/java/com/example/infraandroid/id/view/LoginFragment.kt index 0b9d5d7..c56d5af 100644 --- a/app/src/main/java/com/example/infraandroid/id/view/LoginFragment.kt +++ b/app/src/main/java/com/example/infraandroid/id/view/LoginFragment.kt @@ -7,7 +7,7 @@ import android.util.Log import android.widget.Toast import androidx.navigation.findNavController import androidx.navigation.fragment.findNavController -import com.example.infraandroid.BuildConfig +//import com.example.infraandroid.BuildConfig import com.example.infraandroid.util.InfraApplication import com.example.infraandroid.R import com.example.infraandroid.databinding.FragmentLoginBinding diff --git a/app/src/main/java/com/example/infraandroid/myinfo/MyInfoFragment.kt b/app/src/main/java/com/example/infraandroid/myinfo/MyInfoFragment.kt index 025a180..4a2e876 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/MyInfoFragment.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/MyInfoFragment.kt @@ -34,18 +34,16 @@ class MyInfoFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - //함수로 간단하게 묶기 - // 어떻게 하면 더 깔끔하게 코드를 정리할 수 있을까..! 데이터 바인딩..? - mBinding!!.myInfoMyInfoLayout.setOnClickListener { + mBinding!!.myInfoMyInfoLinearlayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_my_info_modify_fragment) } - mBinding!!.myInfoIntroPageLayout.setOnClickListener { + /* mBinding!!.myInfoIntroPageLayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_myInfoInformationFragment) - } + }*/ mBinding!!.myInfoMyIdeaLinearlayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_myInfoMyIdeaFragment) } - mBinding!!.myInfoEvaluationLinearlayout.setOnClickListener { + /* mBinding!!.myInfoEvaluationLinearlayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_myInfoTeamMemberEvaluationFragment) } mBinding!!.myInfoInterestLinearlayout.setOnClickListener { @@ -62,7 +60,7 @@ class MyInfoFragment : Fragment() { } mBinding!!.myInfoHashtagAlarmLinearlayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_hashTagAlarmFragment) - } + }*/ mBinding!!.myInfoUserGuideLinearlayout.setOnClickListener { it.findNavController().navigate(R.id.action_my_info_fragment_to_userGuideFragment) } diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/model/ResponseViewMyInfoData.kt b/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/model/ResponseViewMyInfoData.kt index eb51441..ca87490 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/model/ResponseViewMyInfoData.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/model/ResponseViewMyInfoData.kt @@ -4,7 +4,7 @@ data class ResponseViewMyInfoData( val isSuccess: Boolean, val code: Int, val message: String, - val result: ArrayList?, + val result: Result, ){ data class Result( val user_nickname: String, diff --git a/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/view/MyInfoModifyFragment.kt b/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/view/MyInfoModifyFragment.kt index a1da518..2031bd4 100644 --- a/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/view/MyInfoModifyFragment.kt +++ b/app/src/main/java/com/example/infraandroid/myinfo/myinfomodify/view/MyInfoModifyFragment.kt @@ -20,50 +20,49 @@ import com.example.infraandroid.R import com.example.infraandroid.databinding.FragmentMyInfoModifyBinding import com.example.infraandroid.myinfo.myinfomodify.model.RequestModifyMyInfoData import com.example.infraandroid.myinfo.myinfomodify.model.ResponseViewMyInfoData +import com.example.infraandroid.util.BaseFragment +import com.example.infraandroid.util.InfraApplication import com.example.infraandroid.util.ServiceCreator import retrofit2.Call import retrofit2.Callback import retrofit2.Response //내 정보 > 내 정보 .kt -class MyInfoModifyFragment : Fragment() { - private var mBinding : FragmentMyInfoModifyBinding? = null +class MyInfoModifyFragment : BaseFragment(R.layout.fragment_my_info_modify) { + /*private var mBinding : FragmentMyInfoModifyBinding? = null*/ private var isChecked = false + private var userNickname : String ?= null + private var userPrPhoto : String ?= null - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - val binding = FragmentMyInfoModifyBinding.inflate(inflater, container, false) - - mBinding = binding - - return mBinding?.root + override fun FragmentMyInfoModifyBinding.onCreateView() { } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) + override fun FragmentMyInfoModifyBinding.onViewCreated() { + + val inputNicknameEditText = binding.inputNicknameEditText as EditText + val myInfoModifyBackButton = binding.myInfoModifyBackButton as ImageView + val myInfoModifyUserProfileLayout = binding.myInfoModifyUserProfileLayout as ConstraintLayout + val overlapCheckButton = binding.overlapCheckButton as AppCompatButton + val modifyCompletedButton = binding.modifyCompletedButton as TextView + val doNotUseThisNicknameTextView = binding.doNotUseThisNicknameTextView as TextView - val inputNicknameEditText = mBinding?.inputNicknameEditText as EditText - val myInfoModifyBackButton = mBinding?.myInfoModifyBackButton as ImageView - val myInfoModifyUserProfileLayout = mBinding?.myInfoModifyUserProfileLayout as ConstraintLayout - val overlapCheckButton = mBinding?.overlapCheckButton as AppCompatButton - val modifyCompletedButton = mBinding?.modifyCompletedButton as TextView - val doNotUseThisNicknameTextView = mBinding?.doNotUseThisNicknameTextView as TextView //내 정보 보기 서버 연결 val viewcall: Call = ServiceCreator.myinfoService - .viewMyInfo("jwt","userId") - /*.viewMyInfo(InfraApplication.prefs.getString("jwt","null"),InfraApplication.prefs.getString("userId","null"))*/ + .viewMyInfo(InfraApplication.prefs.getString("jwt","null"),InfraApplication.prefs.getString("userId","null")) + /* .viewMyInfo("jwt","userId")*/ + viewcall.enqueue(object : Callback { override fun onResponse( call: Call, response: Response ) { - val body = response.body() if(response.isSuccessful){ when(response.body()?.code){ + 1000 -> { binding.myInfoModify = response.body()?.result + userNickname = response.body()?.result?.user_nickname + userPrPhoto = response.body()?.result?.user_prPhoto + } } } @@ -119,7 +118,7 @@ class MyInfoModifyFragment : Fragment() { } override fun afterTextChanged(p0: Editable?) { - //얘네는 나중에 수정 필요 + /*inputNicknameEditText.length() < 12 && inputNicknameEditText.length()>0*/ if (inputNicknameEditText.length() < 12) { overlapCheckButton.isEnabled = true } else { @@ -137,6 +136,31 @@ class MyInfoModifyFragment : Fragment() { } }) + //수정 완료 버튼 활성화 설정 + inputNicknameEditText.addTextChangedListener(object: TextWatcher{ + override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { + modifyCompletedButton.isEnabled = false + } + + override fun afterTextChanged(p0: Editable?) { + /*inputNicknameEditText.length() < 12 && inputNicknameEditText.length()>0*/ + if (inputNicknameEditText.length() < 12) { + modifyCompletedButton.isEnabled = true + } else { + Toast.makeText(requireActivity(), "12자 이하로 입력해주세요.", Toast.LENGTH_SHORT).show() + } + } + + override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) { + //얘네는 나중에 수정 필요 + if (inputNicknameEditText.length() < 12) { + modifyCompletedButton.isEnabled = true + } else { + Toast.makeText(requireActivity(), "12자 이하로 입력해주세요.", Toast.LENGTH_SHORT).show() + } + } + }) + //닉네임 중복 서버 연결 필요 //닉네임 중복 버튼 누르면 overlapCheckButton.setOnClickListener { @@ -145,18 +169,13 @@ class MyInfoModifyFragment : Fragment() { isChecked = true doNotUseThisNicknameTextView.isVisible = false inputNicknameEditText.setBackgroundResource(R.drawable.can_use_this_id_background) - mBinding?.canUseIconImageView?.isVisible = true + binding.canUseIconImageView?.isVisible = true } else { doNotUseThisNicknameTextView.isVisible = true inputNicknameEditText.setBackgroundResource(R.drawable.double_check_id_background) - mBinding?.canUseIconImageView?.isVisible = false + binding.canUseIconImageView?.isVisible = false } } } - - override fun onDestroyView() { - mBinding = null - super.onDestroyView() - } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_category_idea.xml b/app/src/main/res/layout/fragment_category_idea.xml index da4f1ef..8a9fe0f 100644 --- a/app/src/main/res/layout/fragment_category_idea.xml +++ b/app/src/main/res/layout/fragment_category_idea.xml @@ -171,6 +171,7 @@ android:layout_marginTop="16dp" android:gravity="left"/> + diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 9ec3045..9e19bbc 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -71,6 +71,7 @@ app:layout_constraintStart_toEndOf="@id/home_user_characteristic1_tv" app:layout_constraintTop_toTopOf="@id/home_user_characteristic1_tv" /> + + + + + + + + + + + - - - --> + + android:layout_marginTop="32dp"> + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_my_info_modify.xml b/app/src/main/res/layout/fragment_my_info_modify.xml index 92888cb..278bf97 100644 --- a/app/src/main/res/layout/fragment_my_info_modify.xml +++ b/app/src/main/res/layout/fragment_my_info_modify.xml @@ -3,9 +3,9 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"> - - - + @@ -103,6 +105,20 @@ android:includeFontPadding="false" android:textSize="14sp" android:textColorHint="@color/infra_gray_t"/> + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_project.xml b/app/src/main/res/layout/item_project.xml index 71d5140..7c9cc51 100644 --- a/app/src/main/res/layout/item_project.xml +++ b/app/src/main/res/layout/item_project.xml @@ -131,6 +131,7 @@ android:layout_marginEnd="10dp" android:layout_marginBottom="10dp" /> + diff --git a/app/src/main/res/values/app_key.xml b/app/src/main/res/values/app_key.xml index 55344e5..61344a5 100644 --- a/app/src/main/res/values/app_key.xml +++ b/app/src/main/res/values/app_key.xml @@ -1,3 +1,5 @@ + kakao587212d6545a4f67a054a6ed1845f527 + 587212d6545a4f67a054a6ed1845f527 \ No newline at end of file