diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/AddTimeResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/AddTimeResponse.kt new file mode 100644 index 00000000..44890c9c --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/AddTimeResponse.kt @@ -0,0 +1,18 @@ +package umc.com.mobile.project.data.model.plan + +data class AddTimeResponse( +val semesterDto: SemesterDto, +val subjectDtoList: List, +) + +data class SemesterDto( + val grade: Long, + val semester: Long, +) + +data class SubjectDtoList( + val type: String, + val name: String, + val credit: Long, +) + diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/BringlicenseResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/BringlicenseResponse.kt new file mode 100644 index 00000000..d437092c --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/BringlicenseResponse.kt @@ -0,0 +1,16 @@ +package umc.com.mobile.project.data.model.plan + +import java.time.LocalDateTime + +data class BringlicenseResponse( + val isSuccess: Boolean, + val code: String, + val message: String, + val result: List, +) + +data class BringResult( + val certificateId: Long, + val createdAt: String, +) + diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/ListTimeResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/ListTimeResponse.kt new file mode 100644 index 00000000..0ebe8053 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/ListTimeResponse.kt @@ -0,0 +1,17 @@ +package umc.com.mobile.project.data.model.plan + + + +data class ListTimeResponse( + val isSuccess: Boolean, + val code: String, + val message: String, + val result: List, +) + +data class TimeResult( + val searchGrade: String, + val searchType: String, + val searchName: String, + val searchCredit: String, +) diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/PlanTrackResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/PlanTrackResponse.kt new file mode 100644 index 00000000..1c956a16 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/PlanTrackResponse.kt @@ -0,0 +1,14 @@ +package umc.com.mobile.project.data.model.plan + +data class PlanTrackResponse( + val isSuccess: Boolean, + val code: String, + val message: String, + val result: List, +) + +data class TrackResult( + val trackCode: String, + val trackName: String, +) + diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/SavelicenseRequest.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/SavelicenseRequest.kt new file mode 100644 index 00000000..478df2ed --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/SavelicenseRequest.kt @@ -0,0 +1,16 @@ +package umc.com.mobile.project.data.model.plan + +import java.time.LocalDate + + +data class SaveInfo( + val name: String, + val date: String +) + +data class SavelicenseRequest( + val info: List +) + + + diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/SemesterTimeResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/SemesterTimeResponse.kt new file mode 100644 index 00000000..7a9e4924 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/SemesterTimeResponse.kt @@ -0,0 +1,17 @@ +package umc.com.mobile.project.data.model.plan + +data class SemesterTimeResponse( + val isSuccess: Boolean, + val code: String, + val message: String, + val result: List, +) { + + +} + +data class semesterResult( + val hakkiNum: String, + val hakkiText: String, +) + diff --git a/app/src/main/java/umc/com/mobile/project/data/model/plan/UPlicenseResponse.kt b/app/src/main/java/umc/com/mobile/project/data/model/plan/UPlicenseResponse.kt new file mode 100644 index 00000000..a62acc4b --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/model/plan/UPlicenseResponse.kt @@ -0,0 +1,14 @@ +package umc.com.mobile.project.data.model.plan + +data class UPlicenseResponse( + val isSuccess: Boolean, + val code: String, + val message: String, + val result: List, +) + +data class Result( + val certificateId: Long, + val name: String, + val date: String, +) diff --git a/app/src/main/java/umc/com/mobile/project/data/network/api/PlanApi.kt b/app/src/main/java/umc/com/mobile/project/data/network/api/PlanApi.kt new file mode 100644 index 00000000..61e5b44c --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/data/network/api/PlanApi.kt @@ -0,0 +1,38 @@ +package umc.com.mobile.project.data.network.api + +import retrofit2.http.GET +import retrofit2.Call +import retrofit2.http.Body +import retrofit2.http.POST +import retrofit2.http.Query +import umc.com.mobile.project.data.model.plan.BringlicenseResponse +import umc.com.mobile.project.data.model.plan.ListTimeResponse +import umc.com.mobile.project.data.model.plan.PlanTrackResponse +import umc.com.mobile.project.data.model.plan.SaveInfo +import umc.com.mobile.project.data.model.plan.SemesterTimeResponse +import umc.com.mobile.project.data.model.plan.UPlicenseResponse + + +interface PlanApi { + @GET("plans/certifications") + fun getUPlicense(): Call + + + @POST("plans/certifications") + fun saveLicense(@Body request: List): Call + + + + + @GET("/plans/timetable/searchSubject") + fun getListTime(@Query("hakki") hakki:String, @Query("track") track : String) : Call + + @GET("/plans/timetable/searchTrack") + fun getTrackInfo(@Query("hakki") hakki: String) : Call + + @GET("/plans/timetable/searchHakki") + fun getSemesterInfo():Call + + + +} \ No newline at end of file diff --git a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/GradeFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/GradeFragment.kt index fc5dd5f1..65f6da94 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/GradeFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/GradeFragment.kt @@ -39,6 +39,10 @@ class GradeFragment : Fragment() { binding.tvSemester.text = selectedSemester }) + viewModel.totalAverage.observe(viewLifecycleOwner, Observer { totalAverageGrade -> + binding.tvAverageTotal.text = totalAverageGrade.toString() + }) + viewModel.selectedSemesterGradeAndGrades.observe(viewLifecycleOwner) { pair -> val selectedGrade = pair.first val gradesMap = pair.second diff --git a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/adapter/AverageRVAdapter.kt b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/adapter/AverageRVAdapter.kt index 437cd636..5fe96cec 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/adapter/AverageRVAdapter.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/adapter/AverageRVAdapter.kt @@ -1,5 +1,6 @@ package umc.com.mobile.project.ui.gradInfo.adapter +import android.app.AlertDialog import androidx.recyclerview.widget.RecyclerView import android.view.LayoutInflater import android.view.ViewGroup @@ -10,6 +11,7 @@ import umc.com.mobile.project.ui.gradInfo.viewmodel.GradeViewModel class AverageRVAdapter(private val viewModel: GradeViewModel) : RecyclerView.Adapter() { private var dataList = mutableListOf() + var totalAverageGrade = 0.0 inner class MyViewHolder(private val binding: ItemAverageGradeBinding) : RecyclerView.ViewHolder(binding.root) { @@ -21,20 +23,32 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) : val semesterGrade = "${position + 1} 학기 성적" viewModel.onSemesterItemClick(semester) viewModel.onSemesterGradeItemClick(semesterGrade) + + val gradesTotalDto = dataList[position] + if (gradesTotalDto.averageGrade == "0.0") { + val alertDialogBuilder = AlertDialog.Builder(binding.root.context) + alertDialogBuilder.setTitle("알림") + alertDialogBuilder.setMessage("${position + 1} 학기의 성적이 아직 입력되지 않았습니다.") + alertDialogBuilder.setPositiveButton("확인") { dialog, _ -> + dialog.dismiss() + } + } } } } fun bind(gradesTotalDto: GradesTotalDto, position: Int) { - val count = if (position % 2 == 0) { + val semester = if (position % 2 == 0) { 1 } else { 2 } - val semester = if (position % 2 == 0) position / 2 + 1 else (position + 1) / 2 + val grade = if (position % 2 == 0) position / 2 + 1 else (position + 1) / 2 +// totalAverageGrade += Integer.parseInt(gradesTotalDto.averageGrade) - binding.tvSemesterContent1.text = "$semester - $count" + binding.tvSemesterContent1.text = "$grade - $semester" binding.tvAverageGradeContent1.text = gradesTotalDto.averageGrade +// viewModel.onSetTotalAverageGrade(totalAverageGrade, position+1) } } @@ -69,6 +83,7 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) : ) ) } + notifyDataSetChanged() } diff --git a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/CompletionStateViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/CompletionStateViewModel.kt index 4f0d2509..632910c1 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/CompletionStateViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/CompletionStateViewModel.kt @@ -22,38 +22,6 @@ class CompletionStateViewModel : ViewModel() { val completionInfo: MutableLiveData get() = _completionInfo - // 필수교양기초 - private val _requiredBasicCourses: MutableLiveData> = MutableLiveData() - val requiredBasicCourses: LiveData> - get() = _requiredBasicCourses - - private val _foundationElectiveCourses: MutableLiveData> = MutableLiveData() - val foundationElectiveCourses: LiveData> - get() = _foundationElectiveCourses - - // 전공 트랙 - private val _majorTrack1Courses: MutableLiveData> = MutableLiveData() - val majorTrack1Courses: MutableLiveData> - get() = _majorTrack1Courses - - private fun processRequiredBasicCourses(completionResponse: CompletionResponse) { - val requiredBasicCoursesMap = mutableMapOf() -// val majorTrack1CoursesList = completionResponse.result.completionDtoMaptrack1 -// val majorTrack2CoursesList = completionResponse.result.majorRequirements.track1 - - /* - _majorTrack1Courses?.let { - for ((index, courseName) in requiredBasicCourses.withIndex()) { - majorTrack1CoursesMap["Course ${index + 1}"] = courseName - Log.d("Completion: foundationElectiveCoursesMap ", "Course ${index + 1} : $courseName") - } - }*/ - - _requiredBasicCourses.postValue(requiredBasicCoursesMap) -// _majorTrack1Courses.postValue(majorTrack1CoursesMap) - } - - fun getCompletionInfo() { gradInfoApiService.getCompletion().enqueue(object : Callback { override fun onResponse( diff --git a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/GradeViewModel.kt b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/GradeViewModel.kt index 522f9638..44ff1dc7 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/GradeViewModel.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/gradInfo/viewmodel/GradeViewModel.kt @@ -21,50 +21,6 @@ class GradeViewModel : ViewModel() { val error: LiveData get() = _error - private val _userSemester: MutableLiveData = MutableLiveData() - val userSemester: LiveData - get() = _userSemester - - private val _userClassification: MutableLiveData = MutableLiveData() - val userClassification: LiveData - get() = _userClassification - - private val _userSubjectName: MutableLiveData = MutableLiveData() - val userSubjectName: LiveData - get() = _userSubjectName - - private val _userCredits: MutableLiveData = MutableLiveData() - val userCredits: LiveData - get() = _userCredits - - private val _userGrade: MutableLiveData = MutableLiveData() - val userGrade: LiveData - get() = _userGrade - - private val _userTrack: MutableLiveData = MutableLiveData() - val userTrack: LiveData - get() = _userTrack - - private val _userAppliedCredit: MutableLiveData = MutableLiveData() - val userAppliedCredit: LiveData - get() = _userAppliedCredit - - private val _userAcquiredCredit: MutableLiveData = MutableLiveData() - val userAcquiredCredit: LiveData - get() = _userAcquiredCredit - - private val _userAverageTotal: MutableLiveData = MutableLiveData() - val userAverageTotal: LiveData - get() = _userAverageTotal - - private val _userAverageGrade: MutableLiveData = MutableLiveData() - val userAverageGrade: LiveData - get() = _userAverageGrade - - private val _userPercentile: MutableLiveData = MutableLiveData() - val userPercentile: LiveData - get() = _userPercentile - private val _gradesInfo: MutableLiveData = MutableLiveData() val gradesInfo: MutableLiveData get() = _gradesInfo @@ -85,6 +41,10 @@ class GradeViewModel : ViewModel() { private val selectedSemesterGrade: LiveData get() = _selectedSemesterGrade + private val _totalAverage: MutableLiveData = MutableLiveData() + val totalAverage: LiveData + get() = _totalAverage + val selectedSemesterGradeAndGrades: MediatorLiveData?>> = MediatorLiveData() init { @@ -174,4 +134,8 @@ class GradeViewModel : ViewModel() { fun onSemesterGradeItemClick(grade: String) { _selectedSemesterGrade.postValue(grade) } -} \ No newline at end of file + + fun onSetTotalAverageGrade(totalAverageGrade: Double, totalNumber: Int) { + _totalAverage.postValue((totalAverageGrade/totalNumber)) + } + } \ No newline at end of file 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 e75c1873..f2fbee5c 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 @@ -61,6 +61,9 @@ class HomeFragment : Fragment() { binding.btnCheeringWordMove.setOnClickListener { navigate(R.id.action_fragment_home_to_fragment_date) } + binding.layoutNextPlan.setOnClickListener { + navigate(R.id.action_fragment_home_to_planSettingFragment) + } } private fun saveCheeringMemo() { 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 new file mode 100644 index 00000000..9e52d868 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanFreeFragment.kt @@ -0,0 +1,34 @@ +package umc.com.mobile.project.ui.plan + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import umc.com.mobile.project.databinding.FragmentPlanFreeBinding +import umc.com.mobile.project.ui.plan.PlanViewModel + +class PlanFreeFragment : Fragment() { + private var _binding: FragmentPlanFreeBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? + ): View { + _binding = FragmentPlanFreeBinding.inflate(inflater, container, false) + + viewModel.text.observe(viewLifecycleOwner) { text -> + // Update your UI here with the LiveData update + // Make sure 'textViewExample' matches the ID of the TextView in your layout +// binding.textViewExample.text = text + } + return binding.root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = 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/PlanRVAdapter.kt new file mode 100644 index 00000000..4a058e66 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRVAdapter.kt @@ -0,0 +1,34 @@ +package umc.com.mobile.project.ui.plan + +import android.text.Editable +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import umc.com.mobile.project.data.model.career.ActivityWithAccumulatedHour +import umc.com.mobile.project.databinding.ItemCertificateBinding + +class PlanRVAdapter(private val activityList: List): RecyclerView.Adapter(){ + + override fun getItemCount(): Int { + return activityList?.size ?: 0 + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ActivityViewHolder { + val itemBinding = ItemCertificateBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return ActivityViewHolder(itemBinding) + } + + override fun onBindViewHolder(holder: ActivityViewHolder, position: Int) { + val editableFactory = Editable.Factory.getInstance() + + val startDate = activityList[position].startDate ?: "" + val title = activityList[position].title ?: "" + val index = activityList[position].reindex.toString() ?: "" + + holder.itemBinding.etCertificateDate.text = editableFactory.newEditable(startDate) + holder.itemBinding.etCertificateTitle.text = editableFactory.newEditable(title) + holder.itemBinding.etCertificateRating.text = editableFactory.newEditable(index) + } + + class ActivityViewHolder(val itemBinding: ItemCertificateBinding) : RecyclerView.ViewHolder(itemBinding.root) +} \ No newline at end of file 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/PlanRecyclerAdapter.kt new file mode 100644 index 00000000..b7dad88a --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanRecyclerAdapter.kt @@ -0,0 +1,39 @@ +package umc.com.mobile.project.ui.plan + +import android.text.Editable +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import umc.com.mobile.project.data.model.career.PointDtoList +import umc.com.mobile.project.data.model.career.Result +import umc.com.mobile.project.data.model.plan.TimeResult +import umc.com.mobile.project.databinding.ItemCertificateBinding +import umc.com.mobile.project.databinding.ItemTimeSubjectBinding + +class PlanRecyclerAdapter( timeList: List): RecyclerView.Adapter(){ + var timeList: List = timeList + set(value) { + field = value + notifyDataSetChanged() + //데이터가 바뀌었다 알려줌. + } + + + override fun getItemCount(): Int { + return timeList?.size ?: 0 + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlanRecyclerAdapter.NonSubjectViewHolder { + val itemBinding = ItemTimeSubjectBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return PlanRecyclerAdapter.NonSubjectViewHolder(itemBinding) + } + + override fun onBindViewHolder(holder: PlanRecyclerAdapter.NonSubjectViewHolder, position: Int) { + + holder.itemBinding.timeItemScore.text =timeList[position]?.searchCredit.toString() + holder.itemBinding.timeItemSemester.text =timeList[position]?.searchGrade.toString() + holder.itemBinding.timeItemSubject.text = timeList[position]?.searchName.toString() + } + + class NonSubjectViewHolder(val itemBinding: ItemTimeSubjectBinding) : RecyclerView.ViewHolder(itemBinding.root) +} \ No newline at end of file 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/PlanSemesterAdapter.kt new file mode 100644 index 00000000..912f19e5 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterAdapter.kt @@ -0,0 +1,37 @@ +package umc.com.mobile.project.ui.plan + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import umc.com.mobile.project.data.model.plan.semesterResult +import umc.com.mobile.project.databinding.ItemChooseSemesterBinding + +class PlanSemesterAdapter( semesterList: List): RecyclerView.Adapter(){ + var semesterList: List = semesterList + set(value) { + field = value + notifyDataSetChanged() + //데이터가 바뀌었다 알려줌. + } + + + override fun getItemCount(): Int { + return semesterList?.size ?: 0 + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlanSemesterAdapter.NonSubjectViewHolder { + val itemBinding = ItemChooseSemesterBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return PlanSemesterAdapter.NonSubjectViewHolder(itemBinding) + } + + override fun onBindViewHolder(holder: PlanSemesterAdapter.NonSubjectViewHolder, position: Int) { + + val semesterInfo = semesterList[position] + if (semesterInfo != null) { + holder.itemBinding.planTimeSemesterItem.text = semesterInfo.hakkiText + } + + } + + class NonSubjectViewHolder(val itemBinding: ItemChooseSemesterBinding) : RecyclerView.ViewHolder(itemBinding.root) +} \ No newline at end of file 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 new file mode 100644 index 00000000..c173abbd --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSemesterFragment.kt @@ -0,0 +1,74 @@ +package umc.com.mobile.project.ui.plan + +import android.content.res.ColorStateList +import android.os.Bundle +import android.text.Editable +import android.text.TextWatcher +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.content.ContextCompat +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import androidx.gridlayout.widget.GridLayout +import umc.com.mobile.project.R +import umc.com.mobile.project.databinding.FragmentPlanlicenseBinding +import android.widget.EditText +import androidx.core.view.setMargins +import androidx.lifecycle.Observer +import androidx.recyclerview.widget.LinearLayoutManager + +import umc.com.mobile.project.data.model.plan.SavelicenseRequest +import umc.com.mobile.project.data.model.plan.semesterResult +import umc.com.mobile.project.databinding.SemesterChooseBinding +import java.time.LocalDate + +class PlanSemesterFragment : Fragment() { + private var _binding: SemesterChooseBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = SemesterChooseBinding.inflate(inflater, container, false) + + + + + + return binding.root + } + + + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + + val adapter = PlanSemesterAdapter(listOf()) // 초기 데이터로 빈 리스트 사용 + + // RecyclerView에 어댑터와 레이아웃 매니저 설정 + binding.recyclerViewPlanSemester.adapter = adapter + binding.recyclerViewPlanSemester.layoutManager = LinearLayoutManager(context) + + + viewModel.planSemesterInfo.observe(viewLifecycleOwner) { semesterInfo -> + // 데이터가 업데이트되면 어댑터의 리스트 업데이트 + adapter.semesterList = semesterInfo?.result ?: emptyList() + adapter.notifyDataSetChanged() + + } + + viewModel.getSemesterInfo() // 데이터 로드 + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} + + 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 new file mode 100644 index 00000000..51b01b19 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanSettingFragment.kt @@ -0,0 +1,73 @@ +package umc.com.mobile.project.ui.plan + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import androidx.lifecycle.Observer +import androidx.viewpager.widget.ViewPager +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.FragmentSettingBinding +import umc.com.mobile.project.databinding.PlanTimeTabMainBinding +import umc.com.mobile.project.ui.gradInfo.adapter.GradInfoVPAdapter +import umc.com.mobile.project.ui.gradInfo.viewmodel.GradInfoViewModel + +class PlanSettingFragment : Fragment() { + private var _binding:PlanTimeTabMainBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + private lateinit var viewPager : ViewPager2 + private lateinit var tabLayout : TabLayout + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = PlanTimeTabMainBinding.inflate(inflater, container, false) + + initTabLayout() + initViewPager() + + + return binding.root + } + + private fun initTabLayout() { + + val tabTitle = arrayOf("시간표", "자격증", "자유") + + + viewPager = binding.viewPagerTimeTabMain + tabLayout = binding.tabLayoutPlanTime + + + val adapter = PlanVPAdapter(this) + + adapter.addFragment(PlanTimeFragment()) + adapter.addFragment(PlanlicenseFragment()) + adapter.addFragment(PlanFreeFragment()) + + viewPager.orientation = ViewPager2.ORIENTATION_HORIZONTAL + viewPager.adapter = adapter + + TabLayoutMediator(tabLayout, viewPager + ) { tab, position -> tab.text = tabTitle[position] }.attach() + } + + private fun initViewPager() { + + binding.viewPagerTimeTabMain.isUserInputEnabled = false + } + + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..8def1b7a --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTimeFragment.kt @@ -0,0 +1,80 @@ +package umc.com.mobile.project.ui.plan + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import androidx.lifecycle.Observer +import androidx.navigation.fragment.findNavController +import androidx.recyclerview.widget.LinearLayoutManager +import umc.com.mobile.project.R +import umc.com.mobile.project.data.model.plan.TimeResult +import umc.com.mobile.project.databinding.FragmentPlanTimeBinding +import umc.com.mobile.project.databinding.PlanSubjectListBinding +import umc.com.mobile.project.ui.common.NavigationUtil.navigate +import umc.com.mobile.project.ui.plan.PlanViewModel + +class PlanTimeFragment : Fragment() { + private var _binding: PlanSubjectListBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? + ): View { + _binding = PlanSubjectListBinding.inflate(inflater, container, false) + + + + viewModel.getListTimeInfo() + val adapter = viewModel.listTimeInfo.value?.let { PlanRecyclerAdapter(it.result) } + + binding.recyclerView.adapter = adapter + binding.recyclerView.layoutManager = + LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) + + + + viewModel.listTimeInfo.observe(viewLifecycleOwner) { timenewList -> + if (timenewList != null) { + if (adapter != null) { + adapter.timeList=timenewList.result + adapter.notifyDataSetChanged() + } + } + + + + + } + + + + return binding.root + + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + + binding.planSubjectListSemester.setOnClickListener { + + findNavController().navigate(R.id.action_planTimeFragment_to_planSemesterFragment) + } + } + + + + + + + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + +} 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/PlanTrackAdapter.kt new file mode 100644 index 00000000..3bbc6ae5 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackAdapter.kt @@ -0,0 +1,37 @@ +package umc.com.mobile.project.ui.plan + +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): RecyclerView.Adapter(){ + var trackList: List = trackList + set(value) { + field = value + notifyDataSetChanged() + //데이터가 바뀌었다 알려줌. + } + + + override fun getItemCount(): Int { + return trackList?.size ?: 0 + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlanTrackAdapter.NonSubjectViewHolder { + val itemBinding = ItemChooseTrackBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return PlanTrackAdapter.NonSubjectViewHolder(itemBinding) + } + + override fun onBindViewHolder(holder: PlanTrackAdapter.NonSubjectViewHolder, position: Int) { + + holder.itemBinding.planTimeTrackItem.text =trackList[position]?.trackName.toString() + + } + + class NonSubjectViewHolder(val itemBinding: ItemChooseTrackBinding) : RecyclerView.ViewHolder(itemBinding.root) +} \ No newline at end of file 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 new file mode 100644 index 00000000..75f1bf64 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanTrackFragment.kt @@ -0,0 +1,57 @@ +package umc.com.mobile.project.ui.plan + +import android.content.res.ColorStateList +import android.os.Bundle +import android.text.Editable +import android.text.TextWatcher +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.content.ContextCompat +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import androidx.gridlayout.widget.GridLayout +import umc.com.mobile.project.R +import umc.com.mobile.project.databinding.FragmentPlanlicenseBinding +import android.widget.EditText +import androidx.core.view.setMargins +import androidx.lifecycle.Observer +import umc.com.mobile.project.data.model.plan.SavelicenseRequest +import umc.com.mobile.project.data.model.plan.semesterResult +import umc.com.mobile.project.databinding.PlanTimeChooseTrackBinding +import umc.com.mobile.project.databinding.SemesterChooseBinding +import java.time.LocalDate + +class PlanTrackFragment : Fragment() { + private var _binding: PlanTimeChooseTrackBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = PlanTimeChooseTrackBinding.inflate(inflater, container, false) + + + + + + return binding.root + } + + + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = 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/PlanVPAdapter.kt new file mode 100644 index 00000000..eda363ff --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanVPAdapter.kt @@ -0,0 +1,27 @@ +package umc.com.mobile.project.ui.plan + +import androidx.fragment.app.Fragment +import androidx.viewpager2.adapter.FragmentStateAdapter + +class PlanVPAdapter(fragment: Fragment): FragmentStateAdapter(fragment) { + // 페이지 갯수 설정 + val fragmentList : MutableList = arrayListOf() + + override fun getItemCount(): Int { + return fragmentList.size + } + + override fun createFragment(position: Int): Fragment { + return fragmentList[position] + } + + fun addFragment(fragment: Fragment){ + fragmentList.add(fragment) + notifyItemInserted(fragmentList.size - 1) + } + + fun removeFragment(){ + fragmentList.removeLast() + notifyItemRemoved(fragmentList.size) + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..268e5193 --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanViewModel.kt @@ -0,0 +1,237 @@ +package umc.com.mobile.project.ui.plan + + +import android.util.Log +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import umc.com.mobile.project.data.model.plan.BringlicenseResponse +import umc.com.mobile.project.data.model.plan.ListTimeResponse +import umc.com.mobile.project.data.model.plan.SaveInfo + +import umc.com.mobile.project.data.model.plan.SavelicenseRequest +import umc.com.mobile.project.data.model.plan.SemesterTimeResponse + +import umc.com.mobile.project.data.model.plan.UPlicenseResponse +import umc.com.mobile.project.data.network.ApiClient +import umc.com.mobile.project.data.network.api.PlanApi + +class PlanViewModel : ViewModel() { + + + //api + private val planApiService = ApiClient.createService() + + private val _hakki: MutableLiveData = MutableLiveData() + val hakki: LiveData + get() = _hakki + + private val _track: MutableLiveData = MutableLiveData() + val track: LiveData + get() = _track + + + private val _planSemesterInfo : MutableLiveData = MutableLiveData() + val planSemesterInfo :LiveData + get()=_planSemesterInfo + + + private val _planTimeStatus: MutableLiveData = MutableLiveData() + val planTimeStatus: LiveData + get() = _planTimeStatus + + private val _bringLicenseInfo = MutableLiveData() + + + private val _listTimeInfo = MutableLiveData() + + val listTimeInfo: LiveData + get() = _listTimeInfo + + val bringLicenseInfo: LiveData + get() = _bringLicenseInfo + + + + + + private val _licenseInfo: MutableLiveData = MutableLiveData() + val licenseInfo: LiveData + get() = _licenseInfo + + + private val _error: MutableLiveData = MutableLiveData() + val error: LiveData + get() = _error + + + private val _savelicenseInfo : MutableLiveData =MutableLiveData() + val savelicenseInfo : LiveData + get()=_savelicenseInfo + + + // 기존에 있던 text LiveData + private val _text = MutableLiveData().apply { + value = "This is Plan Fragment" + } + val text: LiveData = _text + + // 새로 추가된 isFilledAllOptions LiveData + private val _isFilledAllOptions = MutableLiveData().apply { + value = false // 초기값 설정 + } + val isFilledAllOptions: LiveData = _isFilledAllOptions + + // isFilledAllOptions의 값을 업데이트하는 메서드 + fun updateIsFilledAllOptions(isFilled: Boolean) { + _isFilledAllOptions.value = isFilled + } + + + fun getListTimeInfo() { + _hakki.value?.let { + _track.value?.let { it1 -> + planApiService.getListTime(it, it1).enqueue(object : Callback { + override fun onResponse( + call: Call, + response: Response + ) { + if (response.isSuccessful) { + if (response.body() != null) { + _listTimeInfo.postValue(response.body()) + Log.d("Planlicense", "${response.body()}") + } else { + _error.postValue("서버 응답이 올바르지 않습니다.") + } + } else { + _error.postValue("사용자 정보를 가져오지 못했습니다.") + try { + throw response.errorBody()?.string()?.let { + RuntimeException(it) + } ?: RuntimeException("Unknown error") + } catch (e: Exception) { + Log.e("PlanInfo", "PlanResponse API 오류: ${e.message}") + } + } + } + + override fun onFailure(call: Call, t: Throwable) { + _error.postValue("네트워크 오류: ${t.message}") + Log.d("gradInfo", "completion: ${t.message}") + } + }) + } + } + } + + + fun getLicenseInfo() { + planApiService.getUPlicense().enqueue(object : Callback { + override fun onResponse( + call: Call, + response: Response + ) { + if (response.isSuccessful) { + if (response.body() != null) { + _licenseInfo.postValue(response.body()) + Log.d("Planlicense", "${response.body()}") + } else { + _error.postValue("서버 응답이 올바르지 않습니다.") + } + } else { + _error.postValue("사용자 정보를 가져오지 못했습니다.") + try { + throw response.errorBody()?.string()?.let { + RuntimeException(it) + } ?: RuntimeException("Unknown error") + } catch (e: Exception) { + Log.e("PlanInfo", "PlanResponse API 오류: ${e.message}") + } + } + } + + override fun onFailure(call: Call, t: Throwable) { + _error.postValue("네트워크 오류: ${t.message}") + Log.d("gradInfo", "completion: ${t.message}") + } + }) + } + + + fun saveLicense(request: List) { + + planApiService.saveLicense(request).enqueue(object : Callback { + override fun onResponse(call: Call, response: Response + ) { + if (response.isSuccessful) { + _bringLicenseInfo.postValue(response.body()) + Log.d("PlanViewModel", "License saved successfully: ${response.body()}") + } else { + _error.postValue("자격증 정보 저장 실패: ${response.errorBody()?.string()}") + Log.e( + "PlanViewModel", + "Error saving license: ${response.errorBody()?.string()}" + ) + } + } + + override fun onFailure(call: Call, t: Throwable) { + _error.postValue("네트워크 오류: ${t.message}") + Log.e("PlanViewModel", "Network error: ${t.message}") + } + }) + } + + + + fun getSemesterInfo() { + planApiService.getSemesterInfo().enqueue(object : Callback { + override fun onResponse( + call: Call, + response: Response + ) { + if (response.isSuccessful) { + if (response.body() != null) { + _planSemesterInfo.postValue(response.body()) + Log.d("PlanSemester", "${response.body()}") + } else { + _error.postValue("서버 응답이 올바르지 않습니다.") + } + } else { + _error.postValue("사용자 정보를 가져오지 못했습니다.") + try { + throw response.errorBody()?.string()?.let { + RuntimeException(it) + } ?: RuntimeException("Unknown error") + } catch (e: Exception) { + Log.e("PlanInfo", "PlanResponse API 오류: ${e.message}") + } + } + } + + override fun onFailure(call: Call, t: Throwable) { + _error.postValue("네트워크 오류: ${t.message}") + Log.d("gradInfo", "completion: ${t.message}") + } + }) + } +} + + + + + + + + + + + + + + + + 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 new file mode 100644 index 00000000..92f2d90e --- /dev/null +++ b/app/src/main/java/umc/com/mobile/project/ui/plan/PlanlicenseFragment.kt @@ -0,0 +1,139 @@ +package umc.com.mobile.project.ui.plan + +import android.content.res.ColorStateList +import umc.com.mobile.project.data.model.plan.SaveInfo +import android.os.Bundle +import android.text.Editable +import android.text.TextWatcher +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.core.content.ContextCompat +import androidx.fragment.app.Fragment +import androidx.fragment.app.viewModels +import umc.com.mobile.project.R +import umc.com.mobile.project.databinding.FragmentPlanlicenseBinding + +class PlanlicenseFragment : Fragment() { + private var _binding: FragmentPlanlicenseBinding? = null + private val viewModel: PlanViewModel by viewModels() + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + _binding = FragmentPlanlicenseBinding.inflate(inflater, container, false) + + + + viewModel.getLicenseInfo() // api 연결 + + + + + // UPlicenseResponse-자격증 정보 불러오기 + viewModel.licenseInfo.observe(viewLifecycleOwner) { licenseInfo -> + licenseInfo?.result?.let { resultList -> + // 첫 번째 Result 객체에 접근하여 데이터 매핑 + resultList.getOrNull(0)?.let { firstResult -> + binding.planLicenseName.setText(firstResult.name) + binding.planLicenseDate.setText(firstResult.date) + } + + // 두 번째 Result 객체에 접근하여 데이터 매핑 + resultList.getOrNull(1)?.let { secondResult -> + binding.planLicenseName2.setText(secondResult.name) + binding.planLicenseDate2.setText(secondResult.date) + + } + + resultList.getOrNull(2)?.let { thirdResult -> + binding.planLicenseName3.setText(thirdResult.name) + binding.planLicenseDate3.setText(thirdResult.date) + + + } + + resultList.getOrNull(3)?.let { fourthResult -> + binding.planLicenseName4.setText(fourthResult.name) + binding.planLicenseDate4.setText(fourthResult.date) + } + } + } + + + return binding.root + } + + private fun submitData() { + + val name = binding.planLicenseName.text.toString() + val date = binding.planLicenseDate.text.toString() + + // SaveInfo 객체 리스트 생성 + val saveInfoList = listOf(SaveInfo(name, date)) + + // SavelicenseRequest 객체 생성 + + + // API 호출 + viewModel.saveLicense(saveInfoList) + + } + + + private fun setupEditTextListener(){ + val textWatcher = object : TextWatcher { + override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { + // 필요 없음 + } + + override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { + // 입력이 변경될 때마다 호출됩니다. + checkIfAnyInputIsFilled() + } + + override fun afterTextChanged(s: Editable?) { + // 필요 없음 + } + } + binding.planLicenseName.addTextChangedListener(textWatcher) + } + + private fun checkIfAnyInputIsFilled() { + val isAnyFieldFilled = binding.planLicenseName.text.trim().isNotEmpty() + //버튼 활성화 업데이트 + binding.licenseButtonStore.isEnabled = isAnyFieldFilled + + // 버튼 색상도 업데이트 + val colorResId = if (isAnyFieldFilled) R.color.skyBlue else R.color.gray + val color = ContextCompat.getColor(requireContext(), colorResId) + binding.licenseButtonStore.backgroundTintList = ColorStateList.valueOf(color) + + + + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + setupEditTextListener() + checkIfAnyInputIsFilled() // 초기 상태 확인 + binding.licenseButtonStore.setOnClickListener { + submitData() // 사용자 입력을 기반으로 API 호출 + } + + + + + + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } + } + + diff --git a/app/src/main/java/umc/com/mobile/project/ui/setting/SettingFragment.kt b/app/src/main/java/umc/com/mobile/project/ui/setting/SettingFragment.kt index a30a8e9b..4b69de5a 100644 --- a/app/src/main/java/umc/com/mobile/project/ui/setting/SettingFragment.kt +++ b/app/src/main/java/umc/com/mobile/project/ui/setting/SettingFragment.kt @@ -10,16 +10,18 @@ import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels +import androidx.lifecycle.Observer import umc.com.mobile.project.MainActivity import umc.com.mobile.project.R import umc.com.mobile.project.databinding.FragmentSettingBinding import umc.com.mobile.project.ui.common.NavigationUtil.navigate +import umc.com.mobile.project.ui.home.viewmodel.HomeViewModel import umc.com.mobile.project.ui.login.LoginActivity import umc.com.mobile.project.ui.setting.viewmodel.SettingViewModel class SettingFragment : Fragment() { private var _binding: FragmentSettingBinding? = null - private val viewModel: SettingViewModel by viewModels() + private val viewModel: HomeViewModel by viewModels() private val binding get() = _binding!! override fun onCreateView( @@ -31,6 +33,11 @@ class SettingFragment : Fragment() { navigateFragment() + viewModel.userInfoResponse.observe(viewLifecycleOwner, Observer { + binding.tvAccountIdContent.text = it?.result?.id.toString() + binding.tvAccountMajorContent.text = "1트랙: ${it?.result?.track1} / 트랙: ${it?.result?.track2}" + }) + return binding.root } @@ -51,12 +58,10 @@ class SettingFragment : Fragment() { fun toast() { Toast.makeText(requireContext(), "로그아웃 되었습니다.", Toast.LENGTH_SHORT).show() -// MyApplication.prefs.edit.remove("email") // 여기서 Shared Preference 를 remove 한다! -// MyApplication.prefs.edit.remove("password") -// MyApplication.prefs.edit.commit() // SP 삭제되는 것을 확인 val intent = Intent(requireContext(), LoginActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP startActivity(intent) + requireActivity().finish() } var dialogLister = DialogInterface.OnClickListener { p0, p1 -> when (p1) { diff --git a/app/src/main/res/drawable/edittext_bottom_line.xml b/app/src/main/res/drawable/edittext_bottom_line.xml new file mode 100644 index 00000000..55a1f162 --- /dev/null +++ b/app/src/main/res/drawable/edittext_bottom_line.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/edittext_rounded_line.xml b/app/src/main/res/drawable/edittext_rounded_line.xml new file mode 100644 index 00000000..65a4fc6c --- /dev/null +++ b/app/src/main/res/drawable/edittext_rounded_line.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/drawable/edittext_white_line.xml b/app/src/main/res/drawable/edittext_white_line.xml new file mode 100644 index 00000000..8ece0846 --- /dev/null +++ b/app/src/main/res/drawable/edittext_white_line.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/main/res/drawable/license_button.xml b/app/src/main/res/drawable/license_button.xml new file mode 100644 index 00000000..fc5595b6 --- /dev/null +++ b/app/src/main/res/drawable/license_button.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/plan_checkbox.xml b/app/src/main/res/drawable/plan_checkbox.xml new file mode 100644 index 00000000..723f21b8 --- /dev/null +++ b/app/src/main/res/drawable/plan_checkbox.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/drawable/rectangle_4257.xml b/app/src/main/res/drawable/rectangle_4257.xml new file mode 100644 index 00000000..f4c4644b --- /dev/null +++ b/app/src/main/res/drawable/rectangle_4257.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/rectangle_4343.xml b/app/src/main/res/drawable/rectangle_4343.xml new file mode 100644 index 00000000..963502b2 --- /dev/null +++ b/app/src/main/res/drawable/rectangle_4343.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/semester_all_choose.xml b/app/src/main/res/drawable/semester_all_choose.xml new file mode 100644 index 00000000..0ea653ef --- /dev/null +++ b/app/src/main/res/drawable/semester_all_choose.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/semester_cancle_button.xml b/app/src/main/res/drawable/semester_cancle_button.xml new file mode 100644 index 00000000..261b0c1a --- /dev/null +++ b/app/src/main/res/drawable/semester_cancle_button.xml @@ -0,0 +1,20 @@ + + + + diff --git a/app/src/main/res/drawable/time_rounded_corners.xml b/app/src/main/res/drawable/time_rounded_corners.xml new file mode 100644 index 00000000..b2310abe --- /dev/null +++ b/app/src/main/res/drawable/time_rounded_corners.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/app/src/main/res/drawable/time_solid_beige_radius_without_top_right_20.xml b/app/src/main/res/drawable/time_solid_beige_radius_without_top_right_20.xml new file mode 100644 index 00000000..d68fe85b --- /dev/null +++ b/app/src/main/res/drawable/time_solid_beige_radius_without_top_right_20.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/time_solid_beige_top_radius_20.xml b/app/src/main/res/drawable/time_solid_beige_top_radius_20.xml new file mode 100644 index 00000000..9c095cf7 --- /dev/null +++ b/app/src/main/res/drawable/time_solid_beige_top_radius_20.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/time_solid_white_radius_20.xml b/app/src/main/res/drawable/time_solid_white_radius_20.xml new file mode 100644 index 00000000..8148a8bc --- /dev/null +++ b/app/src/main/res/drawable/time_solid_white_radius_20.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/time_store_button.xml b/app/src/main/res/drawable/time_store_button.xml new file mode 100644 index 00000000..292b73b0 --- /dev/null +++ b/app/src/main/res/drawable/time_store_button.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/time_subject_two_button.xml b/app/src/main/res/drawable/time_subject_two_button.xml new file mode 100644 index 00000000..3523fbd4 --- /dev/null +++ b/app/src/main/res/drawable/time_subject_two_button.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/time_track_name_title.xml b/app/src/main/res/drawable/time_track_name_title.xml new file mode 100644 index 00000000..c28c74c0 --- /dev/null +++ b/app/src/main/res/drawable/time_track_name_title.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable/vector_618.xml b/app/src/main/res/drawable/vector_618.xml new file mode 100644 index 00000000..a0e7ad07 --- /dev/null +++ b/app/src/main/res/drawable/vector_618.xml @@ -0,0 +1,12 @@ + + + diff --git a/app/src/main/res/layout/activity_plan_choose.xml b/app/src/main/res/layout/activity_plan_choose.xml new file mode 100644 index 00000000..565820cf --- /dev/null +++ b/app/src/main/res/layout/activity_plan_choose.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_grad_condition.xml b/app/src/main/res/layout/fragment_grad_condition.xml index 0f5f38b0..70e33d35 100644 --- a/app/src/main/res/layout/fragment_grad_condition.xml +++ b/app/src/main/res/layout/fragment_grad_condition.xml @@ -62,7 +62,6 @@ android:layout_marginTop="30dp" android:layout_marginEnd="23dp" android:maxEms="10" - android:text="@{vm.register}" android:textColor="@color/skyBlue" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -75,7 +74,6 @@ android:layout_marginTop="26dp" android:layout_marginEnd="23dp" android:maxEms="10" - android:text="@{vm.grades}" android:textColor="@color/skyBlue" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_register_content" /> @@ -108,7 +106,6 @@ android:layout_marginTop="26dp" android:layout_marginEnd="23dp" android:maxEms="10" - android:text="@{vm.point}" android:textColor="@color/skyBlue" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_credit_content" /> @@ -133,36 +130,10 @@ android:layout_marginEnd="23dp" android:layout_marginBottom="30dp" android:maxEms="10" - android:text="@{vm.scores}" android:textColor="@color/skyBlue" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/tv_point_content" /> - @@ -261,7 +260,6 @@ android:gravity="center" android:paddingTop="14dp" android:paddingBottom="14dp" - android:text="@{vm.userAcquiredCredit}" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -276,7 +274,6 @@ android:gravity="center" android:paddingTop="14dp" android:paddingBottom="14dp" - android:text="@{vm.userAverageTotal}" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -291,7 +288,6 @@ android:gravity="center" android:paddingTop="14dp" android:paddingBottom="14dp" - android:text="@{vm.userAverageGrade}" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -306,7 +302,6 @@ android:gravity="center" android:paddingTop="14dp" android:paddingBottom="14dp" - android:text="@{vm.userPercentile}" android:textColor="@color/black" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 21357d1e..6042fdd7 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -275,7 +275,7 @@ app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toStartOf="@+id/layout_next_plan" + app:layout_constraintTop_toTopOf="@+id/layout_next_plan" /> diff --git a/app/src/main/res/layout/fragment_plan_free.xml b/app/src/main/res/layout/fragment_plan_free.xml new file mode 100644 index 00000000..6a51637c --- /dev/null +++ b/app/src/main/res/layout/fragment_plan_free.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_planlicense.xml b/app/src/main/res/layout/fragment_planlicense.xml new file mode 100644 index 00000000..15240148 --- /dev/null +++ b/app/src/main/res/layout/fragment_planlicense.xml @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_setting.xml b/app/src/main/res/layout/fragment_setting.xml index 9fc2db85..87bad31a 100644 --- a/app/src/main/res/layout/fragment_setting.xml +++ b/app/src/main/res/layout/fragment_setting.xml @@ -3,6 +3,15 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> + + + + + + + @@ -60,6 +69,18 @@ app:layout_constraintStart_toStartOf="@+id/tv_account_title" app:layout_constraintTop_toBottomOf="@+id/tv_account_title" /> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_choose_track.xml b/app/src/main/res/layout/item_choose_track.xml new file mode 100644 index 00000000..aee29c06 --- /dev/null +++ b/app/src/main/res/layout/item_choose_track.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_license.xml b/app/src/main/res/layout/item_license.xml new file mode 100644 index 00000000..890c0913 --- /dev/null +++ b/app/src/main/res/layout/item_license.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_plan_time.xml b/app/src/main/res/layout/item_plan_time.xml new file mode 100644 index 00000000..9feecefe --- /dev/null +++ b/app/src/main/res/layout/item_plan_time.xml @@ -0,0 +1,52 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_time_subject.xml b/app/src/main/res/layout/item_time_subject.xml new file mode 100644 index 00000000..f80c954a --- /dev/null +++ b/app/src/main/res/layout/item_time_subject.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/plan_subject_list.xml b/app/src/main/res/layout/plan_subject_list.xml new file mode 100644 index 00000000..9993089d --- /dev/null +++ b/app/src/main/res/layout/plan_subject_list.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/plan_time_choose_track.xml b/app/src/main/res/layout/plan_time_choose_track.xml new file mode 100644 index 00000000..9f4d994d --- /dev/null +++ b/app/src/main/res/layout/plan_time_choose_track.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/plan_time_main.xml b/app/src/main/res/layout/plan_time_main.xml new file mode 100644 index 00000000..d334ee15 --- /dev/null +++ b/app/src/main/res/layout/plan_time_main.xml @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/plan_time_semester.xml b/app/src/main/res/layout/plan_time_semester.xml new file mode 100644 index 00000000..33353533 --- /dev/null +++ b/app/src/main/res/layout/plan_time_semester.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/plan_time_tab_main.xml b/app/src/main/res/layout/plan_time_tab_main.xml new file mode 100644 index 00000000..098b4811 --- /dev/null +++ b/app/src/main/res/layout/plan_time_tab_main.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/semester_choose.xml b/app/src/main/res/layout/semester_choose.xml new file mode 100644 index 00000000..6a2f4b47 --- /dev/null +++ b/app/src/main/res/layout/semester_choose.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml index b7118aec..8d3c4300 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -16,6 +16,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cb7ba89e..82b382c3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,6 +13,7 @@ Notifications + 자격증 이름