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 bfaa463..e220534 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 @@ -103,6 +103,7 @@ class GradeFragment : Fragment() { Handler().postDelayed({ alertDialog.dismiss() - }, 2000) + viewModel.onSetNullCheckGrade(false) + }, 1000) } } 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 0794d8f..59f39ee 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 @@ -21,20 +21,24 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) : binding.root.setOnClickListener { val position = adapterPosition if (position != RecyclerView.NO_POSITION) { - val semester = "${position + 1} 학기" - val semesterGrade = "${position + 1} 학기 성적" - viewModel.onSemesterItemClick(semester) - viewModel.onSemesterGradeItemClick(semesterGrade) - - if (dataList[position].averageGrade == "0.0") { - viewModel.onSetNullCheckGrade(true) - } else { - viewModel.onSetNullCheckGrade(false) - } + handleItemClick(position) } } } + private fun handleItemClick(position: Int) { + val semester = "${position + 1} 학기" + val semesterGrade = "${position + 1} 학기 성적" + viewModel.onSemesterItemClick(semester) + viewModel.onSemesterGradeItemClick(semesterGrade) + + if (dataList[position].averageGrade == "0.0") { + viewModel.onSetNullCheckGrade(true) + } else { + viewModel.onSetNullCheckGrade(false) + } + } + fun bind(gradesTotalDto: GradesTotalDto, position: Int) { val semester = if (position % 2 == 0) { 1 @@ -85,5 +89,4 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) : } - }