mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 06:26:51 -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 {
|
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'
|
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.data.db.entities.Timetable
|
||||||
import io.github.wulkanowy.databinding.DialogTimetableBinding
|
import io.github.wulkanowy.databinding.DialogTimetableBinding
|
||||||
import io.github.wulkanowy.utils.capitalise
|
import io.github.wulkanowy.utils.capitalise
|
||||||
import io.github.wulkanowy.utils.decapitalise
|
|
||||||
import io.github.wulkanowy.utils.getThemeAttrColor
|
import io.github.wulkanowy.utils.getThemeAttrColor
|
||||||
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
import io.github.wulkanowy.utils.lifecycleAwareVariable
|
||||||
import io.github.wulkanowy.utils.toFormattedString
|
import io.github.wulkanowy.utils.toFormattedString
|
||||||
@ -52,7 +51,7 @@ class TimetableDialog : DialogFragment() {
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
with(lesson) {
|
with(lesson) {
|
||||||
setInfo(info, teacher, canceled, changes)
|
setInfo(info, canceled, changes)
|
||||||
setSubject(subject, subjectOld)
|
setSubject(subject, subjectOld)
|
||||||
setTeacher(teacher, teacherOld)
|
setTeacher(teacher, teacherOld)
|
||||||
setGroup(group)
|
setGroup(group)
|
||||||
@ -80,7 +79,7 @@ class TimetableDialog : DialogFragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("DefaultLocale")
|
@SuppressLint("DefaultLocale")
|
||||||
private fun setInfo(info: String, teacher: String, canceled: Boolean, changes: Boolean) {
|
private fun setInfo(info: String, canceled: Boolean, changes: Boolean) {
|
||||||
with(binding) {
|
with(binding) {
|
||||||
when {
|
when {
|
||||||
info.isNotBlank() -> {
|
info.isNotBlank() -> {
|
||||||
@ -102,8 +101,6 @@ class TimetableDialog : DialogFragment() {
|
|||||||
|
|
||||||
timetableDialogChangesValue.text = when {
|
timetableDialogChangesValue.text = when {
|
||||||
canceled && !changes -> "Lekcja odwołana: $info"
|
canceled && !changes -> "Lekcja odwołana: $info"
|
||||||
changes && teacher.isNotBlank() -> "Zastępstwo: $teacher"
|
|
||||||
changes && teacher.isBlank() -> "Zastępstwo, ${info.decapitalise()}"
|
|
||||||
else -> info.capitalise()
|
else -> info.capitalise()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user