From a6a2bcff3b2beec3b535f4e6364f30c28a7bf937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Tue, 24 Aug 2021 19:51:08 +0200 Subject: [PATCH] Remove Zachowanie from all count of subjects (#1447) --- .../ui/modules/grade/summary/GradeSummaryAdapter.kt | 9 +++++++-- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryAdapter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryAdapter.kt index 9a888ddcc..0754361c9 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryAdapter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryAdapter.kt @@ -59,6 +59,7 @@ class GradeSummaryAdapter @Inject constructor( val context = binding.root.context val finalItemsCount = items.count { it.finalGrade.matches("[0-6][+-]?".toRegex()) } val calculatedItemsCount = items.count { value -> value.average != 0.0 } + val allItemsCount = items.count { !it.subject.equals("zachowanie", true) } val finalAverage = items.calcAverage( preferencesRepository.gradePlusModifier, preferencesRepository.gradeMinusModifier @@ -72,11 +73,15 @@ class GradeSummaryAdapter @Inject constructor( gradeSummaryScrollableHeaderFinal.text = formatAverage(finalAverage) gradeSummaryScrollableHeaderCalculated.text = formatAverage(calculatedAverage) gradeSummaryScrollableHeaderFinalSubjectCount.text = - context.getString(R.string.grade_summary_from_subjects, finalItemsCount, items.size) + context.getString( + R.string.grade_summary_from_subjects, + finalItemsCount, + allItemsCount + ) gradeSummaryScrollableHeaderCalculatedSubjectCount.text = context.getString( R.string.grade_summary_from_subjects, calculatedItemsCount, - items.size + allItemsCount ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b655769d4..ee911cfba 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -101,7 +101,7 @@ Predicted grade Calculated average Final average - From %1$d of %2$d subjects + from %1$d of %2$d subjects Summary Class Mark as read