forked from github/szkolny
[UI/Timetable] Show lesson replacing notes in all places.
This commit is contained in:
parent
678baf46e5
commit
dfd1083e41
@ -61,6 +61,7 @@ class CounterActivity : AppCompatActivity(), CoroutineScope {
|
||||
it.type != Lesson.TYPE_SHIFTED_SOURCE
|
||||
})
|
||||
}
|
||||
lessonList.onEach { it.filterNotes() }
|
||||
}
|
||||
|
||||
b.bellSync.setImageDrawable(
|
||||
@ -101,13 +102,15 @@ class CounterActivity : AppCompatActivity(), CoroutineScope {
|
||||
|
||||
when {
|
||||
actual != null -> {
|
||||
b.lessonName.text = actual.displaySubjectName
|
||||
b.lessonName.text = actual.getNoteSubstituteText(showNotes = true)
|
||||
?: actual.displaySubjectName
|
||||
|
||||
val left = actual.displayEndTime!! - now
|
||||
b.timeLeft.text = timeLeft(left.toInt(), "\n", countInSeconds)
|
||||
}
|
||||
next != null -> {
|
||||
b.lessonName.text = next.displaySubjectName
|
||||
b.lessonName.text = next.getNoteSubstituteText(showNotes = true)
|
||||
?: next.displaySubjectName
|
||||
|
||||
val till = next.displayStartTime!! - now
|
||||
b.timeLeft.text = timeTill(till.toInt(), "\n", countInSeconds)
|
||||
|
@ -232,6 +232,7 @@ class HomeTimetableCard(
|
||||
}
|
||||
|
||||
lessons = lessons.filter { it.type != Lesson.TYPE_NO_LESSONS }
|
||||
lessons.onEach { it.filterNotes() }
|
||||
|
||||
b.timetableLayout.visibility = View.VISIBLE
|
||||
b.noTimetableLayout.visibility = View.GONE
|
||||
@ -344,6 +345,7 @@ class HomeTimetableCard(
|
||||
|
||||
private val LessonFull?.subjectSpannable: CharSequence
|
||||
get() = if (this == null) "?" else when {
|
||||
hasReplacingNotes() -> getNoteSubstituteText(showNotes = true) ?: "?"
|
||||
isCancelled -> displaySubjectName?.asStrikethroughSpannable() ?: "?"
|
||||
isChange -> displaySubjectName?.asItalicSpannable() ?: "?"
|
||||
else -> displaySubjectName ?: "?"
|
||||
|
@ -337,8 +337,11 @@ class WidgetTimetableProvider : AppWidgetProvider() {
|
||||
scrollPos = pos + 1
|
||||
}
|
||||
|
||||
// remove notes from other profiles
|
||||
lesson.filterNotes()
|
||||
// set the subject and classroom name
|
||||
model.subjectName = lesson.displaySubjectName
|
||||
model.subjectName = lesson.getNoteSubstituteText(showNotes = true)
|
||||
?: lesson.displaySubjectName
|
||||
model.classroomName = lesson.displayClassroom
|
||||
|
||||
// set the bell sync to calculate progress in ListProvider
|
||||
|
@ -19,7 +19,7 @@ public class ItemWidgetTimetableModel {
|
||||
public Time endTime;
|
||||
public boolean lessonPassed;
|
||||
public boolean lessonCurrent;
|
||||
public String subjectName = "";
|
||||
public CharSequence subjectName = "";
|
||||
public String classroomName = "";
|
||||
public boolean lessonChange = false;
|
||||
public boolean lessonChangeNoClassroom = false;
|
||||
|
Loading…
Reference in New Issue
Block a user