Skip to content

Commit

Permalink
Fix: 향후계획 시간표 조회 및 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
dkyuuum committed Feb 23, 2024
1 parent ffb3b5c commit baf146e
Show file tree
Hide file tree
Showing 20 changed files with 60 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,10 @@ class CompletionStateFragment : Fragment() {
viewModel.completionInfo.observe(viewLifecycleOwner, Observer { it ->
val completionDtoMap: List<Map<String, List<String>>>? = 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)
}
Expand All @@ -68,18 +54,19 @@ class CompletionStateFragment : Fragment() {
/**
* 필수 교양 (소양) - 나단
*/
/*
completionDtoMap?.firstOrNull { it.containsKey("필수교양(소양)") }?.get("필수교양(소양)")?.let { requiredBasicCourses2 ->
binding.tvSoyang1.text = requiredBasicCourses2[0]
binding.tvSoyang1Content.text = requiredBasicCourses2[1]
binding.tvSoyang2.text = requiredBasicCourses2[2]
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]
Expand All @@ -89,7 +76,6 @@ class CompletionStateFragment : Fragment() {
completionDtoMap?.firstOrNull { it.containsKey("소 계") }?.get("소 계")?.let {
binding.tvTotalScore.text = it[0]
}
*/

/**
* 트랙 1, 트랙 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -18,12 +17,12 @@ class PlanSemesterAdapter(semesterList: List<semesterResult?>, 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<Any> = ArrayList()): ListAdapter<TimeInfoResponse, PlanTimeAdapter.ViewHolder>(UpTimeResultDiffCallback()) {
class PlanTimeAdapter(private var addnewtime: List<Any> = ArrayList()): ListAdapter<TimeInfoResponse, PlanTimeAdapter.ViewHolder>(
UpTimeResultDiffCallback()
) {

class ViewHolder(private val binding: ItemPlanTimeBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: TimeInfoResponse) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<TrackResult?>, private val onItemClick: (TrackResult) -> Unit) : RecyclerView.Adapter<PlanTrackAdapter.NonSubjectViewHolder>() {
Expand All @@ -24,12 +21,12 @@ class PlanTrackAdapter(trackList: List<TrackResult?>, 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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package umc.com.mobile.project.ui.plan
package umc.com.mobile.project.ui.plan.viewmodel


import android.util.Log
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_planlicense.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<variable
name="vm"
type="umc.com.mobile.project.ui.plan.PlanViewModel" />
type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" />
</data>

<androidx.core.widget.NestedScrollView
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/plan_subject_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<variable
name="vm"
type="umc.com.mobile.project.ui.plan.PlanViewModel" />
type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -35,7 +35,7 @@
style="@style/MediumFont.13"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="35dp"
android:layout_marginStart="35dp"
android:layout_marginTop="16dp"
android:background="@drawable/rectangle_4343"
android:gravity="center"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/plan_time_choose_track.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
android:id="@+id/recyclerView_plan_track"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="10dp"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginEnd="10dp"
app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/semester_const_layout"
tools:listitem="@layout/item_choose_track" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/plan_time_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<data>
<variable
name="vm"
type="umc.com.mobile.project.ui.plan.PlanViewModel" />
type="umc.com.mobile.project.ui.plan.viewmodel.PlanViewModel" />
</data>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
Expand Down
50 changes: 24 additions & 26 deletions app/src/main/res/layout/semester_choose.xml
Original file line number Diff line number Diff line change
@@ -1,73 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/semester_choose_const"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
android:layout_height="match_parent">


<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/semester_title"
style="@style/SemiBoldFont.16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="학기선택"
android:layout_marginTop="62dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="학기선택"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

/>



<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/plan_semester_backspace"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@+id/semester_title"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="5dp"
android:layout_marginRight="8dp"
android:background="@drawable/semester_cancle_button"
android:layout_marginTop="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/semester_title"

/>

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/semester_const_layout"
android:layout_width="322dp"
android:layout_height="223dp"
android:background="@drawable/rectangle_4257"
android:paddingLeft="8dp"
android:paddingRight="9dp"
android:paddingBottom="7dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="19dp"
android:layout_marginTop="28dp"
android:layout_marginEnd="19dp"
android:layout_marginBottom="19dp"
android:background="@drawable/rectangle_4257"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toBottomOf="@+id/semester_title">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView_plan_semester"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
app:layout_constraintTop_toTopOf="@id/semester_const_layout"
tools:listitem="@layout/item_choose_semester"

/>
tools:listitem="@layout/item_choose_semester" />

</androidx.constraintlayout.widget.ConstraintLayout>




</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit baf146e

Please sign in to comment.