1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2025-01-19 00:26:45 -06:00

Fix crash on unknown attendance category type (#949)

This commit is contained in:
Mikołaj Pich 2020-09-07 09:35:26 +02:00 committed by GitHub
parent 9f85b2206a
commit c30f105be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ configurations.all {
} }
dependencies { dependencies {
implementation "io.github.wulkanowy:sdk:0.20.3" implementation "io.github.wulkanowy:sdk:0faa503"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'

View File

@ -27,7 +27,7 @@ private fun calculatePercentage(presence: Double, absence: Double): Double {
} }
inline val Attendance.description inline val Attendance.description
get() = when (AttendanceCategory.valueOf(name)) { get() = when (AttendanceCategory.getCategoryByName(name)) {
AttendanceCategory.PRESENCE -> R.string.attendance_present AttendanceCategory.PRESENCE -> R.string.attendance_present
AttendanceCategory.ABSENCE_UNEXCUSED -> R.string.attendance_absence_unexcused AttendanceCategory.ABSENCE_UNEXCUSED -> R.string.attendance_absence_unexcused
AttendanceCategory.ABSENCE_EXCUSED -> R.string.attendance_absence_excused AttendanceCategory.ABSENCE_EXCUSED -> R.string.attendance_absence_excused