Skip to content

Commit

Permalink
Merge pull request #102 from FOR-GRAD/14-커리어
Browse files Browse the repository at this point in the history
14 커리어
  • Loading branch information
kimyujin-com authored Feb 20, 2024
2 parents d29311a + 3c5dadf commit 05454e6
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -60,7 +61,6 @@ class CertificateFragment : Fragment() {
false // 그 외의 경우 이벤트 소비하지 않음
}
}

_binding!!.ivCareerCertificateBack.setOnClickListener {
navigate(R.id.action_fragment_certificate_to_fragment_career)
}
Expand All @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 초기화
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CareerApi>()

private val _volunteerDetailInfo: MutableLiveData<CareerDetailResponse?> = MutableLiveData()
Expand Down

0 comments on commit 05454e6

Please sign in to comment.