Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/FOR-GRAD/For-Grad-android i…
Browse files Browse the repository at this point in the history
…nto 21-졸업-요건-ui
  • Loading branch information
dkyuuum committed Feb 20, 2024
2 parents 61315a6 + 888b96f commit de54d76
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 17 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
8 changes: 4 additions & 4 deletions app/src/main/res/menu/bottom_nav_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@

<item
android:id="@+id/fragment_career"
android:icon="@drawable/selector_bottom_career"
android:icon="@drawable/ic_career_28"
android:title="커리어" />

<item
android:id="@+id/fragment_home"
android:icon="@drawable/selector_bottom_home"
android:icon="@drawable/ic_home_28"
android:title="" />

<item
android:id="@+id/fragment_board"
android:icon="@drawable/selector_bottom_board"
android:icon="@drawable/ic_board_28"
android:title="게시판" />

<item
android:id="@+id/fragment_setting"
android:icon="@drawable/selector_bottom_setting"
android:icon="@drawable/ic_setting_28"
android:title="설정" />

</menu>

0 comments on commit de54d76

Please sign in to comment.