forked from github/wulkanowy-mirror
Mark teacher with yellow when new and old are the same (#1529)
This commit is contained in:
parent
a43ffcdef4
commit
2cb11e443c
@ -166,7 +166,7 @@ ext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "io.github.wulkanowy:sdk:8f3721f1f9"
|
implementation "io.github.wulkanowy:sdk:230d2075df"
|
||||||
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
|
||||||
|
@ -360,7 +360,7 @@ class TimetableAdapter @Inject constructor() : RecyclerView.Adapter<RecyclerView
|
|||||||
private fun updateTeacherColor(teacherTextView: TextView, lesson: Timetable) {
|
private fun updateTeacherColor(teacherTextView: TextView, lesson: Timetable) {
|
||||||
teacherTextView.setTextColor(
|
teacherTextView.setTextColor(
|
||||||
teacherTextView.context.getThemeAttrColor(
|
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
|
else android.R.attr.textColorSecondary
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -89,14 +89,22 @@ class TimetableDialog : DialogFragment() {
|
|||||||
R.attr.colorPrimary
|
R.attr.colorPrimary
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
timetableDialogChangesValue.setTextColor(requireContext().getThemeAttrColor(R.attr.colorPrimary))
|
timetableDialogChangesValue.setTextColor(
|
||||||
|
requireContext().getThemeAttrColor(
|
||||||
|
R.attr.colorPrimary
|
||||||
|
)
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
timetableDialogChangesTitle.setTextColor(
|
timetableDialogChangesTitle.setTextColor(
|
||||||
requireContext().getThemeAttrColor(
|
requireContext().getThemeAttrColor(
|
||||||
R.attr.colorTimetableChange
|
R.attr.colorTimetableChange
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
timetableDialogChangesValue.setTextColor(requireContext().getThemeAttrColor(R.attr.colorTimetableChange))
|
timetableDialogChangesValue.setTextColor(
|
||||||
|
requireContext().getThemeAttrColor(
|
||||||
|
R.attr.colorTimetableChange
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
timetableDialogChangesValue.text = when {
|
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
|
teacher.isNotBlank() -> timetableDialogTeacherValue.text = teacher
|
||||||
else -> {
|
else -> {
|
||||||
timetableDialogTeacherTitle.visibility = GONE
|
timetableDialogTeacherTitle.visibility = GONE
|
||||||
|
@ -173,7 +173,7 @@ class TimetableWidgetFactory(
|
|||||||
updateNotCanceledLessonNumberColor(this, lesson)
|
updateNotCanceledLessonNumberColor(this, lesson)
|
||||||
updateNotCanceledSubjectColor(this, lesson)
|
updateNotCanceledSubjectColor(this, lesson)
|
||||||
|
|
||||||
val teacherChange = lesson.teacherOld.isNotBlank() && lesson.teacher != lesson.teacherOld
|
val teacherChange = lesson.teacherOld.isNotBlank()
|
||||||
updateNotCanceledRoom(this, lesson, teacherChange)
|
updateNotCanceledRoom(this, lesson, teacherChange)
|
||||||
updateNotCanceledTeacher(this, lesson, teacherChange)
|
updateNotCanceledTeacher(this, lesson, teacherChange)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user