Mark teacher with yellow when new and old are the same
MODIFY
app/build.gradle
app/build.gradle
@@ -166,7 +166,7 @@ ext {
}
dependencies {
- implementation "io.github.wulkanowy:sdk:8f3721f1f9"
+ implementation "io.github.wulkanowy:sdk:230d2075df"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

MODIFY
app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt
app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableAdapter.kt
@@ -360,7 +360,7 @@ class TimetableAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
private fun updateTeacherColor(teacherTextView: TextView, lesson: Timetable) {
teacherTextView.setTextColor(
teacherTextView.context.getThemeAttrColor(
- if (lesson.teacherOld.isNotBlank() && lesson.teacherOld != lesson.teacher) R.attr.colorTimetableChange
+ if (lesson.teacherOld.isNotBlank()) R.attr.colorTimetableChange
else android.R.attr.textColorSecondary
)
)

MODIFY
app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableDialog.kt
app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableDialog.kt
@@ -89,14 +89,22 @@ class TimetableDialog : DialogFragment() {
R.attr.colorPrimary
)
)
- timetableDialogChangesValue.setTextColor(requireContext().getThemeAttrColor(R.attr.colorPrimary))
+ timetableDialogChangesValue.setTextColor(
+ requireContext().getThemeAttrColor(
+ R.attr.colorPrimary
+ )
+ )
} else {
timetableDialogChangesTitle.setTextColor(
requireContext().getThemeAttrColor(
R.attr.colorTimetableChange
)
)
- timetableDialogChangesValue.setTextColor(requireContext().getThemeAttrColor(R.attr.colorTimetableChange))
+ timetableDialogChangesValue.setTextColor(
+ requireContext().getThemeAttrColor(
+ R.attr.colorTimetableChange
+ )
+ )
}
timetableDialogChangesValue.text = when {
@@ -128,6 +136,15 @@ class TimetableDialog : DialogFragment() {
}
}
}
+ teacherOld.isNotBlank() && teacherOld == teacher -> {
+ timetableDialogTeacherValue.run {
+ visibility = GONE
+ }
+ timetableDialogTeacherNewValue.run {
+ visibility = VISIBLE
+ text = teacher
+ }
+ }
teacher.isNotBlank() -> timetableDialogTeacherValue.text = teacher
else -> {
timetableDialogTeacherTitle.visibility = GONE

MODIFY
app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetFactory.kt
app/src/main/java/io/github/wulkanowy/ui/modules/timetablewidget/TimetableWidgetFactory.kt
@@ -173,7 +173,7 @@ class TimetableWidgetFactory(
updateNotCanceledLessonNumberColor(this, lesson)
updateNotCanceledSubjectColor(this, lesson)
- val teacherChange = lesson.teacherOld.isNotBlank() && lesson.teacher != lesson.teacherOld
+ val teacherChange = lesson.teacherOld.isNotBlank()
updateNotCanceledRoom(this, lesson, teacherChange)
updateNotCanceledTeacher(this, lesson, teacherChange)
}

Mark teacher with yellow when new and old are the same (#1529)