Skip to content

Commit

Permalink
Design: 졸업요건/성적 사항 이수 안 한 학기 색깔 변경 #21
Browse files Browse the repository at this point in the history
  • Loading branch information
dkyuuum committed Feb 18, 2024
1 parent 35f9049 commit 0ec458e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class GradeFragment : Fragment() {
binding.tvAverageGrade.text = selectedGradeInfo?.averageGrade
binding.tvAverageTotal.text = selectedGradeInfo?.totalGrade
binding.tvPercent.text = selectedGradeInfo?.percentile

selectedSemesterPosition = selectedGrade
}

/**
Expand All @@ -90,7 +88,6 @@ class GradeFragment : Fragment() {
override fun onDestroyView() {
super.onDestroyView()
_binding = null
selectedSemesterPosition = null
}

private fun initRecyclerView() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package umc.com.mobile.project.ui.gradInfo.adapter

import android.app.AlertDialog
import android.graphics.Color
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.content.ContentProviderCompat.requireContext
import umc.com.mobile.project.R
import umc.com.mobile.project.data.model.gradInfo.GradesTotalDto
import umc.com.mobile.project.databinding.ItemAverageGradeBinding
import umc.com.mobile.project.ui.gradInfo.GradeFragment
Expand Down Expand Up @@ -34,8 +36,6 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) :

if (dataList[position].averageGrade == "0.0") {
viewModel.onSetNullCheckGrade(true)
} else {
viewModel.onSetNullCheckGrade(false)
}
}

Expand All @@ -45,12 +45,19 @@ class AverageRVAdapter(private val viewModel: GradeViewModel) :
} else {
2
}

val grade = if (position % 2 == 0) position / 2 + 1 else (position + 1) / 2
// totalAverageGrade += Integer.parseInt(gradesTotalDto.averageGrade)

binding.tvSemesterContent1.text = "$grade - $semester"
binding.tvAverageGradeContent1.text = gradesTotalDto.averageGrade
// viewModel.onSetTotalAverageGrade(totalAverageGrade, position+1)

if (gradesTotalDto.averageGrade == "0.0") {
binding.tvAverageGradeContent1.setTextColor(Color.GRAY)
binding.tvSemesterContent1.setTextColor(Color.GRAY)
} else {
binding.tvAverageGradeContent1.setTextColor(Color.BLACK)
binding.tvSemesterContent1.setTextColor(Color.BLACK)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/item_average_grade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1-1"
android:textColor="@{vm.isNullCheckGrade ? @color/gray : @color/black}"
android:textColor="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -46,7 +46,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:text="0.0"
android:textColor="@{vm.isNullCheckGrade ? @color/gray : @color/black}"
android:textColor="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down

0 comments on commit 0ec458e

Please sign in to comment.