mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 02:46:44 -06:00
Display info in timetable as-is when lesson has change flag (#1521)
This commit is contained in:
parent
258782c648
commit
5ba8289c87
@ -157,7 +157,7 @@ ext {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.github.wulkanowy:sdk:1.2.2"
|
||||
implementation "io.github.wulkanowy:sdk:d74acd3989"
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||
|
||||
|
@ -13,7 +13,6 @@ import io.github.wulkanowy.R
|
||||
import io.github.wulkanowy.data.db.entities.Timetable
|
||||
import io.github.wulkanowy.databinding.DialogTimetableBinding
|
||||
import io.github.wulkanowy.utils.capitalise
|
||||
import io.github.wulkanowy.utils.decapitalise
|
||||
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||
import io.github.wulkanowy.utils.toFormattedString
|
||||
@ -52,7 +51,7 @@ class TimetableDialog : DialogFragment() {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
with(lesson) {
|
||||
setInfo(info, teacher, canceled, changes)
|
||||
setInfo(info, canceled, changes)
|
||||
setSubject(subject, subjectOld)
|
||||
setTeacher(teacher, teacherOld)
|
||||
setGroup(group)
|
||||
@ -80,7 +79,7 @@ class TimetableDialog : DialogFragment() {
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
private fun setInfo(info: String, teacher: String, canceled: Boolean, changes: Boolean) {
|
||||
private fun setInfo(info: String, canceled: Boolean, changes: Boolean) {
|
||||
with(binding) {
|
||||
when {
|
||||
info.isNotBlank() -> {
|
||||
@ -102,8 +101,6 @@ class TimetableDialog : DialogFragment() {
|
||||
|
||||
timetableDialogChangesValue.text = when {
|
||||
canceled && !changes -> "Lekcja odwołana: $info"
|
||||
changes && teacher.isNotBlank() -> "Zastępstwo: $teacher"
|
||||
changes && teacher.isBlank() -> "Zastępstwo, ${info.decapitalise()}"
|
||||
else -> info.capitalise()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user