diff --git a/app/src/main/java/umc/com/mobile/project/ui/home/HomeFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/home/HomeFragment.kt index 9d856f1..1fec2cc 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/home/HomeFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/home/HomeFragment.kt @@ -42,7 +42,7 @@ class HomeFragment : Fragment() { setupHomeInfoRetrofit() // 홈 화면 ui 연결 binding.cvHomeProfile.setOnClickListener { - binding.ivHomeProfile.setImageResource(R.drawable.ic_user_profile) +// binding.ivHomeProfile.setImageResource(R.drawable.ic_user_profile) } return binding.root diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt index 4a6c999..931867d 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt @@ -29,12 +29,9 @@ class PlanSettingFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - // PlanTimeTabMainBinding을 인플레이트하여 루트 뷰를 가져옴 _binding = PlanTimeTabMainBinding.inflate(inflater, container, false) val view = binding.root - - // 탭 레이아웃 및 뷰페이저 초기화 initTabLayout() initViewPager() @@ -44,8 +41,6 @@ class PlanSettingFragment : Fragment() { } return view - - } @@ -53,11 +48,9 @@ class PlanSettingFragment : Fragment() { val tabTitle = arrayOf("시간표", "자격증", "자유") - viewPager = binding.viewPagerTimeTabMain tabLayout = binding.tabLayoutPlanTime - val adapter = PlanVPAdapter(this) adapter.addFragment(PlanTimeFragment()) @@ -72,7 +65,6 @@ class PlanSettingFragment : Fragment() { } private fun initViewPager() { - binding.viewPagerTimeTabMain.isUserInputEnabled = false } diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeAdapter.kt index 93f3e3c..f1e4c6a 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeAdapter.kt @@ -31,6 +31,7 @@ class PlanTimeAdapter(private var addnewtime: List = ArrayList()): ListAdap fun updateTimeList(addnewtime: ArrayList) { submitList(addnewtime) + notifyDataSetChanged() } class UpTimeResultDiffCallback : DiffUtil.ItemCallback() { diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimetableFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimetableFragment.kt index ba9fc2b..8be7cf3 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimetableFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimetableFragment.kt @@ -62,57 +62,41 @@ class PlanTimetableFragment : Fragment() { viewModel.setGradeAndSemester(1, 1) viewModel.getTimeInfo(1, 1) Log.d("selected Item",selectedItem) - - } "1학년 2학기" -> { viewModel.setGradeAndSemester(1, 2) viewModel.getTimeInfo(1, 2) - - } "2학년 1학기" -> { viewModel.setGradeAndSemester(2, 1) viewModel.getTimeInfo(2, 1) - - } "2학년 2학기" -> { viewModel.setGradeAndSemester(2, 2) viewModel.getTimeInfo(2, 2) - - } "3학년 1학기" -> { viewModel.setGradeAndSemester(3, 1) viewModel.getTimeInfo(3, 1) - - } "3학년 2학기" -> { viewModel.setGradeAndSemester(3, 2) -// viewModel.getTimeInfo(3, 2) - - + viewModel.getTimeInfo(3, 2) } "4학년 1학기" -> { viewModel.setGradeAndSemester(4, 1) -// viewModel.getTimeInfo(4, 1) - - + viewModel.getTimeInfo(4, 1) } "4학년 2학기" -> { viewModel.setGradeAndSemester(4, 2) -// viewModel.getTimeInfo(4, 2) - - + viewModel.getTimeInfo(4, 2) } } diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt index bb40ddd..599d9e6 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt @@ -177,7 +177,6 @@ val addTimeResponse: MutableLiveData = _addTimeResponse fun addTime(request: AddTimeRequest) { - planApiService.addTime(request).enqueue(object : Callback { override fun onResponse(call: Call, response: Response) { if (response.isSuccessful) { @@ -201,7 +200,6 @@ fun sendAddTimeRequest() { val currentSelectedSubjects = _selectedTimeResults.value ?: return - val grade = _grade.value val semester = _semester.value if (grade == null || semester == null) { @@ -477,7 +475,9 @@ } - + /** + * 시간표 조회하기 + */ fun getTimeInfo(grade:Int, semester:Int) { planApiService.getUptime(grade,semester).enqueue(object : Callback { override fun onResponse( @@ -494,7 +494,6 @@ _selectedTimeResults.value = itemList Log.d("PlanUpTime1", "TimeInfoResponse: $timeList") - Log.d("PlanUpTime", "${response.body()}") } else { Log.d("PlanUpTime", "${response.body()}")