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 09efe7a..0484f6d 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 @@ -31,12 +31,9 @@ class PlanSettingFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle? ): View { - // PlanTimeTabMainBinding을 인플레이트하여 루트 뷰를 가져옴 _binding = PlanTimeTabMainBinding.inflate(inflater, container, false) val view = binding.root - - // 탭 레이아웃 및 뷰페이저 초기화 initTabLayout() initViewPager() @@ -46,8 +43,6 @@ class PlanSettingFragment : Fragment() { } return view - - } @@ -55,11 +50,9 @@ class PlanSettingFragment : Fragment() { val tabTitle = arrayOf("시간표", "자격증", "자유") - viewPager = binding.viewPagerTimeTabMain tabLayout = binding.tabLayoutPlanTime - val adapter = PlanVPAdapter(this) adapter.addFragment(PlanTimeFragment()) @@ -74,7 +67,6 @@ class PlanSettingFragment : Fragment() { } private fun initViewPager() { - binding.viewPagerTimeTabMain.isUserInputEnabled = false } 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 05ca19d..2eed0ab 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 @@ -64,57 +64,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/adapter/PlanTimeAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTimeAdapter.kt index 2123aea..3ee4464 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTimeAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTimeAdapter.kt @@ -33,6 +33,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/viewmodel/PlanViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/viewmodel/PlanViewModel.kt index a9a7e2b..500a763 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/viewmodel/PlanViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/viewmodel/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()}") diff --git a/app/src/main/res/layout/item_plan_time.xml b/app/src/main/res/layout/item_plan_time.xml index e3dcc46..9feecef 100644 --- a/app/src/main/res/layout/item_plan_time.xml +++ b/app/src/main/res/layout/item_plan_time.xml @@ -48,16 +48,5 @@ android:paddingBottom="7dp" android:text="학점" android:textColor="@color/black" /> - \ No newline at end of file