From 25b15408cd2db10a6e70f909ae5b2ce5dcca3221 Mon Sep 17 00:00:00 2001 From: kimyujin-com <80165026+kimyujin-com@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:23:40 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Fix:=20=EC=BB=A4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=ED=95=98=EA=B8=B0=20=EC=A0=84=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EA=B0=80=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../umc/com/mobile/project/ui/career/ActivityFragment.kt | 8 ++++++++ .../umc/com/mobile/project/ui/career/CareerFragment.kt | 1 + .../com/mobile/project/ui/career/CertificateFragment.kt | 9 ++++++++- .../umc/com/mobile/project/ui/career/ContestFragment.kt | 8 ++++++++ .../com/mobile/project/ui/career/VolunteerFragment.kt | 8 ++++++++ .../ui/career/viewmodel/CareerAddActivityViewModel.kt | 3 +++ 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/ActivityFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/career/ActivityFragment.kt index 5a53720f..50d5d1eb 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/ActivityFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/ActivityFragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.OnBackPressedCallback import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.lifecycle.Observer @@ -68,6 +69,13 @@ class ActivityFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + //뒤로가기 버튼 눌렀을 때 + val callback = object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + navigate(R.id.action_fragment_activity_to_fragment_career) + } + } + requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner, callback) //대외 활동 api 연결 viewModel.getActivityInfo() } diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/CareerFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/career/CareerFragment.kt index b937b94f..a7fe5e42 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/CareerFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/CareerFragment.kt @@ -5,6 +5,7 @@ import android.text.Editable import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.OnBackPressedCallback import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import umc.com.mobile.project.R diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/CertificateFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/career/CertificateFragment.kt index 8d815a81..f1331dc7 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/CertificateFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/CertificateFragment.kt @@ -7,6 +7,7 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.OnBackPressedCallback import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.lifecycle.Observer @@ -60,7 +61,6 @@ class CertificateFragment : Fragment() { false // 그 외의 경우 이벤트 소비하지 않음 } } - _binding!!.ivCareerCertificateBack.setOnClickListener { navigate(R.id.action_fragment_certificate_to_fragment_career) } @@ -69,6 +69,13 @@ class CertificateFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + //뒤로가기 버튼 눌렀을 때 + val callback = object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + navigate(R.id.action_fragment_certificate_to_fragment_career) + } + } + requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner, callback) //자격증 목록 api 연결 viewModel.getCertificateInfo() } diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/ContestFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/career/ContestFragment.kt index 91a95d20..bf947114 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/ContestFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/ContestFragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.OnBackPressedCallback import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.lifecycle.Observer @@ -53,6 +54,13 @@ class ContestFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + //뒤로가기 버튼 눌렀을 때 + val callback = object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + navigate(R.id.action_fragment_contest_to_fragment_career) + } + } + requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner, callback) //공모전 목록 api 연결 viewModel.getContestInfo() // adapter 초기화 diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/VolunteerFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/career/VolunteerFragment.kt index e79cc1f1..78f027df 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/VolunteerFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/VolunteerFragment.kt @@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.activity.OnBackPressedCallback import androidx.fragment.app.activityViewModels import androidx.fragment.app.viewModels import androidx.lifecycle.Observer @@ -71,6 +72,13 @@ class VolunteerFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + //뒤로가기 버튼 눌렀을 때 + val callback = object : OnBackPressedCallback(true) { + override fun handleOnBackPressed() { + navigate(R.id.action_fragment_volunteer_to_fragment_career) + } + } + requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner, callback) //봉사 활동 목록 api 연결 viewModel.getVolunteerInfo() } diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt index 4ce6d014..5c93e9e5 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt @@ -70,6 +70,7 @@ class CareerAddActivityViewModel : ViewModel() { } fun addImageFile(file: File) { + Log.d("imagePath", file.toString()) val requestFile = RequestBody.create("image/*".toMediaTypeOrNull(), file) val body = MultipartBody.Part.createFormData("image", file.name, requestFile) imageList.add(body) @@ -179,6 +180,8 @@ class CareerAddActivityViewModel : ViewModel() { } ?: RuntimeException("Unknown error") } catch (e: Exception) { Log.e("addCareerInfo", "addCareer:Extras API 오류: ${e.message}") + val errorMessage = response.errorBody()?.string() + Log.e("addCareerInfo", "addCareer:Extras API 오류: $errorMessage") e.printStackTrace() } } From 9a91cd8470c8ba9f611e76e302d4974361218f57 Mon Sep 17 00:00:00 2001 From: kimyujin-com <80165026+kimyujin-com@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:30:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Remove:=20=EC=BB=A4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EB=8D=94=ED=95=98=EA=B8=B0=20=EB=B6=88=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/ui/career/viewmodel/CareerAddActivityViewModel.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt index 5c93e9e5..4ce6d014 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerAddActivityViewModel.kt @@ -70,7 +70,6 @@ class CareerAddActivityViewModel : ViewModel() { } fun addImageFile(file: File) { - Log.d("imagePath", file.toString()) val requestFile = RequestBody.create("image/*".toMediaTypeOrNull(), file) val body = MultipartBody.Part.createFormData("image", file.name, requestFile) imageList.add(body) @@ -180,8 +179,6 @@ class CareerAddActivityViewModel : ViewModel() { } ?: RuntimeException("Unknown error") } catch (e: Exception) { Log.e("addCareerInfo", "addCareer:Extras API 오류: ${e.message}") - val errorMessage = response.errorBody()?.string() - Log.e("addCareerInfo", "addCareer:Extras API 오류: $errorMessage") e.printStackTrace() } } From 3c5dadf49439181120e57e366bbd7788d5cfe955 Mon Sep 17 00:00:00 2001 From: kimyujin-com <80165026+kimyujin-com@users.noreply.github.com> Date: Tue, 20 Feb 2024 18:37:46 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Remove:=20=EC=BB=A4=EB=A6=AC=EC=96=B4=20?= =?UTF-8?q?=EB=B6=88=ED=95=84=EC=9A=94=20=EC=BD=94=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/career/viewmodel/CareerEditCertificateViewModel.kt | 4 ---- .../project/ui/career/viewmodel/CareerEditContestViewModel.kt | 4 ---- .../ui/career/viewmodel/CareerEditVolunteerViewModel.kt | 4 ---- 3 files changed, 12 deletions(-) diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditCertificateViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditCertificateViewModel.kt index 20f51d07..4b6f3e43 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditCertificateViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditCertificateViewModel.kt @@ -57,10 +57,6 @@ class CareerEditCertificateViewModel : ViewModel() { return !title.value.isNullOrBlank() || !type.value.isNullOrBlank() || !startDate.value.isNullOrBlank() || !endDate.value.isNullOrBlank() } - private fun isDateValid(date: String?): Boolean { - return date.isNullOrBlank() || date.length == 8 - } - fun updateCertificateType(selectedType: String) { type.value = selectedType } diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditContestViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditContestViewModel.kt index 8bd6c799..00833732 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditContestViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditContestViewModel.kt @@ -57,10 +57,6 @@ class CareerEditContestViewModel : ViewModel() { return !title.value.isNullOrBlank() || !award.value.isNullOrBlank() || !startDate.value.isNullOrBlank() || !endDate.value.isNullOrBlank() } - private fun isDateValid(date: String?): Boolean { - return date.isNullOrBlank() || date.length == 8 - } - fun updateSelectedAward(selectedAward: String) { award.value = selectedAward } diff --git a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditVolunteerViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditVolunteerViewModel.kt index 07fcccae..cad2f857 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditVolunteerViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/career/viewmodel/CareerEditVolunteerViewModel.kt @@ -57,10 +57,6 @@ class CareerEditVolunteerViewModel : ViewModel() { return !title.value.isNullOrBlank() || !hour.value.isNullOrBlank() || !startDate.value.isNullOrBlank() || !endDate.value.isNullOrBlank() } - private fun isDateValid(date: String?): Boolean { - return date.isNullOrBlank() || date.length == 8 - } - private val careerApiService = ApiClient.createService() private val _volunteerDetailInfo: MutableLiveData = MutableLiveData() From 4449ffd8d1c6709ce714579d3beed214adf5849a Mon Sep 17 00:00:00 2001 From: kimyujin-com <80165026+kimyujin-com@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:11:12 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Design:=20bottom=5Fnav=5Fmenu=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/menu/bottom_nav_menu.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index 37775248..81d6fdae 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -8,22 +8,22 @@ \ No newline at end of file