Skip to content

Commit

Permalink
Fix: 졸업요건/성적 사항 탭 모달 버그 재수정 #21
Browse files Browse the repository at this point in the history
  • Loading branch information
dkyuuum committed Feb 18, 2024
1 parent c2b2c5a commit 6c775e2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class GradeFragment : Fragment() {

Handler().postDelayed({
alertDialog.dismiss()
}, 2000)
viewModel.onSetNullCheckGrade(false)
}, 1000)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -85,5 +89,4 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) :
}



}

0 comments on commit 6c775e2

Please sign in to comment.