From 48d00a45b1f740cb8529856d4558815133911a2f Mon Sep 17 00:00:00 2001 From: dkyuuum Date: Wed, 21 Feb 2024 13:55:50 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=ED=96=A5=ED=9B=84=20=EA=B3=84?= =?UTF-8?q?=ED=9A=8D=20=ED=95=99=EB=85=84=ED=95=99=EA=B8=B0=20ui=20?= =?UTF-8?q?=EA=B0=B1=EC=8B=A0=20#50?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/project/ui/home/HomeFragment.kt | 2 +- .../project/ui/plan/PlanSettingFragment.kt | 8 ------- .../mobile/project/ui/plan/PlanTimeAdapter.kt | 1 + .../project/ui/plan/PlanTimetableFragment.kt | 22 +++---------------- .../mobile/project/ui/plan/PlanViewModel.kt | 7 +++--- 5 files changed, 8 insertions(+), 32 deletions(-) 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()}") From 82339d3c5bed723bccbd6c3d5bb8d76f58fc0277 Mon Sep 17 00:00:00 2001 From: dkyuuum Date: Wed, 21 Feb 2024 14:17:30 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Design:=20=EC=8B=9C=EA=B0=84=ED=91=9C=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C=20=EC=97=86=EC=95=A0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_plan_time.xml | 11 ----------- 1 file changed, 11 deletions(-) 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