From baf146ec7d1610df5963f05161a712b5bb78a81d Mon Sep 17 00:00:00 2001 From: dkyuuum Date: Fri, 23 Feb 2024 11:22:35 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=ED=96=A5=ED=9B=84=EA=B3=84=ED=9A=8D=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=ED=91=9C=20=EC=A1=B0=ED=9A=8C=20=EB=B0=8F=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/gradInfo/CompletionStateFragment.kt | 20 ++------ .../project/ui/plan/PlanFreeFragment.kt | 3 +- .../project/ui/plan/PlanSemesterFragment.kt | 3 +- .../project/ui/plan/PlanSettingFragment.kt | 2 + .../project/ui/plan/PlanTimeFragment.kt | 4 +- .../project/ui/plan/PlanTimetableFragment.kt | 2 + .../project/ui/plan/PlanTrackFragment.kt | 6 +-- .../project/ui/plan/PlanlicenseFragment.kt | 2 +- .../ui/plan/{ => adapter}/PlanRVAdapter.kt | 2 +- .../plan/{ => adapter}/PlanRecyclerAdapter.kt | 4 +- .../plan/{ => adapter}/PlanSemesterAdapter.kt | 7 ++- .../ui/plan/{ => adapter}/PlanTimeAdapter.kt | 6 ++- .../ui/plan/{ => adapter}/PlanTrackAdapter.kt | 11 ++-- .../ui/plan/{ => adapter}/PlanVPAdapter.kt | 2 +- .../ui/plan/{ => viewmodel}/PlanViewModel.kt | 2 +- .../main/res/layout/fragment_planlicense.xml | 2 +- app/src/main/res/layout/plan_subject_list.xml | 4 +- .../res/layout/plan_time_choose_track.xml | 4 +- app/src/main/res/layout/plan_time_main.xml | 2 +- app/src/main/res/layout/semester_choose.xml | 50 +++++++++---------- 20 files changed, 60 insertions(+), 78 deletions(-) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanRVAdapter.kt (96%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanRecyclerAdapter.kt (93%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanSemesterAdapter.kt (86%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanTimeAdapter.kt (95%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanTrackAdapter.kt (74%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => adapter}/PlanVPAdapter.kt (93%) rename app/src/main/java/umc/com/mobile/project/ui/plan/{ => viewmodel}/PlanViewModel.kt (99%) diff --git a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/CompletionStateFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/CompletionStateFragment.kt index a7805d80..2816fe36 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/CompletionStateFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/CompletionStateFragment.kt @@ -27,24 +27,10 @@ class CompletionStateFragment : Fragment() { viewModel.completionInfo.observe(viewLifecycleOwner, Observer { it -> val completionDtoMap: List>>? = it?.result?.completionDtoMap val basicKeyList = listOf("필수교양(기초)", "필수(기초)교양", "필수교양") + /** * 필수 교양 (기초) */ -/* completionDtoMap?.firstOrNull { it.containsKey("필수교양(기초)") }?.get("필수교양(기초)")?.let { requiredBasicCourses1 -> - binding.tvBasic1.text = requiredBasicCourses1[0] - binding.tvBasic1Content.text = requiredBasicCourses1[1] - binding.tvBasic2.text = requiredBasicCourses1[2] - binding.tvBasic2Content.text = requiredBasicCourses1[3] - binding.tvBasic3.text = requiredBasicCourses1[4] - binding.tvBasic3Content.text = requiredBasicCourses1[5] - -// binding.tvBasic4.text = requiredBasicCourses1[6] -// binding.tvBasic4Content.text = requiredBasicCourses1[7] -// binding.tvBasic5.text = requiredBasicCourses1[8] -// binding.tvBasic5Content.text = requiredBasicCourses1[9] -// binding.tvBasic6.text = requiredBasicCourses1[10] -// binding.tvBasic6Content.text = requiredBasicCourses1[11] - }*/ val requiredBasicCourses = basicKeyList.mapNotNull { key -> completionDtoMap?.firstOrNull { it.containsKey(key) }?.get(key) } @@ -68,6 +54,7 @@ class CompletionStateFragment : Fragment() { /** * 필수 교양 (소양) - 나단 */ + /* completionDtoMap?.firstOrNull { it.containsKey("필수교양(소양)") }?.get("필수교양(소양)")?.let { requiredBasicCourses2 -> binding.tvSoyang1.text = requiredBasicCourses2[0] binding.tvSoyang1Content.text = requiredBasicCourses2[1] @@ -75,11 +62,11 @@ class CompletionStateFragment : Fragment() { binding.tvSoyang2Content.text = requiredBasicCourses2[3] binding.tvTotalScore.text = requiredBasicCourses2[5] } + */ /** * 필수 교양 (소양) - 준현 */ - /* completionDtoMap?.firstOrNull { it.containsKey("토대교양") }?.get("토대교양")?.let { requiredBasicCourses2 -> binding.tvSoyang1.text = requiredBasicCourses2[0] binding.tvSoyang1Content.text = requiredBasicCourses2[1] @@ -89,7 +76,6 @@ class CompletionStateFragment : Fragment() { completionDtoMap?.firstOrNull { it.containsKey("소 계") }?.get("소 계")?.let { binding.tvTotalScore.text = it[0] } - */ /** * 트랙 1, 트랙 2 diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanFreeFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanFreeFragment.kt index ae8e0a56..2d8d0e5b 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanFreeFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanFreeFragment.kt @@ -7,10 +7,9 @@ import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import androidx.fragment.app.viewModels import umc.com.mobile.project.data.model.plan.PlanFreeRequest import umc.com.mobile.project.databinding.FragmentPlanFreeBinding -import umc.com.mobile.project.ui.plan.PlanViewModel +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanFreeFragment : Fragment() { private var _binding: FragmentPlanFreeBinding? = null diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterFragment.kt index 8c754399..b8ec7328 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterFragment.kt @@ -6,12 +6,13 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import umc.com.mobile.project.databinding.SemesterChooseBinding import umc.com.mobile.project.R +import umc.com.mobile.project.ui.plan.adapter.PlanSemesterAdapter +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanSemesterFragment : Fragment() { 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 4a6c9995..09efe7ad 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 @@ -11,6 +11,8 @@ import androidx.viewpager2.widget.ViewPager2 import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator import umc.com.mobile.project.databinding.PlanTimeTabMainBinding +import umc.com.mobile.project.ui.plan.adapter.PlanVPAdapter +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanSettingFragment : Fragment() { private var _binding: PlanTimeTabMainBinding? = null diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeFragment.kt index ac6c2a8c..bd7d6c2a 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeFragment.kt @@ -1,18 +1,18 @@ package umc.com.mobile.project.ui.plan import android.os.Bundle -import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import androidx.fragment.app.viewModels import androidx.recyclerview.widget.LinearLayoutManager import umc.com.mobile.project.R import umc.com.mobile.project.data.model.plan.TimeInfoResponse import umc.com.mobile.project.databinding.PlanSubjectListBinding import umc.com.mobile.project.ui.common.NavigationUtil.navigate +import umc.com.mobile.project.ui.plan.adapter.PlanRecyclerAdapter +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanTimeFragment : Fragment() { 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 ba9fc2b0..05ca19d3 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 @@ -14,6 +14,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import umc.com.mobile.project.R import umc.com.mobile.project.databinding.PlanTimeMainBinding import umc.com.mobile.project.ui.common.NavigationUtil.navigate +import umc.com.mobile.project.ui.plan.adapter.PlanTimeAdapter +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanTimetableFragment : Fragment() { diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackFragment.kt index d521e66d..731c8449 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackFragment.kt @@ -5,15 +5,13 @@ import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import androidx.fragment.app.viewModels import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.LinearLayoutManager import umc.com.mobile.project.R import umc.com.mobile.project.data.model.plan.TrackResult import umc.com.mobile.project.databinding.PlanTimeChooseTrackBinding -import umc.com.mobile.project.ui.plan.PlanSettingFragment -import umc.com.mobile.project.ui.plan.PlanTrackAdapter -import umc.com.mobile.project.ui.plan.PlanViewModel +import umc.com.mobile.project.ui.plan.adapter.PlanTrackAdapter +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanTrackFragment : Fragment() { private var _binding: PlanTimeChooseTrackBinding? = null diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt index 94602daa..b5d873cc 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt @@ -11,10 +11,10 @@ import android.view.ViewGroup import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels -import androidx.fragment.app.viewModels import umc.com.mobile.project.R import umc.com.mobile.project.data.model.plan.CertificateLicenseRequest import umc.com.mobile.project.databinding.FragmentPlanlicenseBinding +import umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel class PlanlicenseFragment : Fragment() { private var _binding: FragmentPlanlicenseBinding? = null diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRVAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRVAdapter.kt similarity index 96% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanRVAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRVAdapter.kt index 4a058e66..6f72cef9 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRVAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRVAdapter.kt @@ -1,4 +1,4 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter import android.text.Editable import android.view.LayoutInflater diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRecyclerAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRecyclerAdapter.kt similarity index 93% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanRecyclerAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRecyclerAdapter.kt index 8c72eeb0..0632af15 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRecyclerAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanRecyclerAdapter.kt @@ -1,10 +1,8 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter -import android.text.Editable import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import umc.com.mobile.project.data.model.plan.TimeInfoResponse import umc.com.mobile.project.data.model.plan.TimeResult import umc.com.mobile.project.databinding.ItemTimeSubjectBinding diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanSemesterAdapter.kt similarity index 86% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanSemesterAdapter.kt index 4ea7acba..061f61ec 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanSemesterAdapter.kt @@ -1,6 +1,5 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter -import android.os.Bundle import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView @@ -18,12 +17,12 @@ class PlanSemesterAdapter(semesterList: List, private val onIte return semesterList.size } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlanSemesterAdapter.NonSubjectViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NonSubjectViewHolder { val itemBinding = ItemChooseSemesterBinding.inflate(LayoutInflater.from(parent.context), parent, false) return NonSubjectViewHolder(itemBinding) } - override fun onBindViewHolder(holder: PlanSemesterAdapter.NonSubjectViewHolder, position: Int) { + override fun onBindViewHolder(holder: NonSubjectViewHolder, position: Int) { val semesterInfo = semesterList[position] if (semesterInfo != null) { holder.itemBinding.planTimeSemesterItem.text = semesterInfo.hakkiText 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/adapter/PlanTimeAdapter.kt similarity index 95% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTimeAdapter.kt index 93f3e3ce..2123aea5 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/adapter/PlanTimeAdapter.kt @@ -1,4 +1,4 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter import android.view.LayoutInflater import android.view.ViewGroup @@ -8,7 +8,9 @@ import androidx.recyclerview.widget.RecyclerView import umc.com.mobile.project.data.model.plan.TimeInfoResponse import umc.com.mobile.project.databinding.ItemPlanTimeBinding -class PlanTimeAdapter(private var addnewtime: List = ArrayList()): ListAdapter(UpTimeResultDiffCallback()) { +class PlanTimeAdapter(private var addnewtime: List = ArrayList()): ListAdapter( + UpTimeResultDiffCallback() +) { class ViewHolder(private val binding: ItemPlanTimeBinding) : RecyclerView.ViewHolder(binding.root) { fun bind(item: TimeInfoResponse) { diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTrackAdapter.kt similarity index 74% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTrackAdapter.kt index 36570244..583e2dfb 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanTrackAdapter.kt @@ -1,12 +1,9 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import umc.com.mobile.project.data.model.plan.PlanTrackResponse import umc.com.mobile.project.data.model.plan.TrackResult -import umc.com.mobile.project.data.model.plan.semesterResult -import umc.com.mobile.project.databinding.ItemChooseSemesterBinding import umc.com.mobile.project.databinding.ItemChooseTrackBinding class PlanTrackAdapter(trackList: List, private val onItemClick: (TrackResult) -> Unit) : RecyclerView.Adapter() { @@ -24,12 +21,12 @@ class PlanTrackAdapter(trackList: List, private val onItemClick: ( return trackList?.size ?: 0 } - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlanTrackAdapter.NonSubjectViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NonSubjectViewHolder { val itemBinding = ItemChooseTrackBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return PlanTrackAdapter.NonSubjectViewHolder(itemBinding) + return NonSubjectViewHolder(itemBinding) } - override fun onBindViewHolder(holder: PlanTrackAdapter.NonSubjectViewHolder, position: Int) { + override fun onBindViewHolder(holder: NonSubjectViewHolder, position: Int) { val trackInfo = trackList[position] if (trackInfo != null) { diff --git a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanVPAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanVPAdapter.kt similarity index 93% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanVPAdapter.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanVPAdapter.kt index eda363ff..01b99652 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/plan/PlanVPAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/adapter/PlanVPAdapter.kt @@ -1,4 +1,4 @@ -package umc.com.mobile.project.ui.plan +package umc.com.mobile.project.ui.plan.adapter import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter 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/viewmodel/PlanViewModel.kt similarity index 99% rename from app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt rename to app/src/main/java/umc/com/mobile/project/ui/plan/viewmodel/PlanViewModel.kt index bb40ddd6..a9a7e2b5 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/viewmodel/PlanViewModel.kt @@ -1,4 +1,4 @@ - package umc.com.mobile.project.ui.plan + package umc.com.mobile.project.ui.plan.viewmodel import android.util.Log diff --git a/app/src/main/res/layout/fragment_planlicense.xml b/app/src/main/res/layout/fragment_planlicense.xml index af6bdfdf..38a60f56 100644 --- a/app/src/main/res/layout/fragment_planlicense.xml +++ b/app/src/main/res/layout/fragment_planlicense.xml @@ -8,7 +8,7 @@ + type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" /> + type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" /> diff --git a/app/src/main/res/layout/plan_time_main.xml b/app/src/main/res/layout/plan_time_main.xml index 9f9a08e8..64f73248 100644 --- a/app/src/main/res/layout/plan_time_main.xml +++ b/app/src/main/res/layout/plan_time_main.xml @@ -6,7 +6,7 @@ + type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" /> + android:layout_height="match_parent"> + android:layout_height="match_parent" /> - + tools:listitem="@layout/item_choose_semester" /> - - - \ No newline at end of file + \ No newline at end of file