mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-24 10:54:36 -06:00
[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
|
it.type != Lesson.TYPE_SHIFTED_SOURCE
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
lessonList.onEach { it.filterNotes() }
|
||||||
}
|
}
|
||||||
|
|
||||||
b.bellSync.setImageDrawable(
|
b.bellSync.setImageDrawable(
|
||||||
@ -101,13 +102,15 @@ class CounterActivity : AppCompatActivity(), CoroutineScope {
|
|||||||
|
|
||||||
when {
|
when {
|
||||||
actual != null -> {
|
actual != null -> {
|
||||||
b.lessonName.text = actual.displaySubjectName
|
b.lessonName.text = actual.getNoteSubstituteText(showNotes = true)
|
||||||
|
?: actual.displaySubjectName
|
||||||
|
|
||||||
val left = actual.displayEndTime!! - now
|
val left = actual.displayEndTime!! - now
|
||||||
b.timeLeft.text = timeLeft(left.toInt(), "\n", countInSeconds)
|
b.timeLeft.text = timeLeft(left.toInt(), "\n", countInSeconds)
|
||||||
}
|
}
|
||||||
next != null -> {
|
next != null -> {
|
||||||
b.lessonName.text = next.displaySubjectName
|
b.lessonName.text = next.getNoteSubstituteText(showNotes = true)
|
||||||
|
?: next.displaySubjectName
|
||||||
|
|
||||||
val till = next.displayStartTime!! - now
|
val till = next.displayStartTime!! - now
|
||||||
b.timeLeft.text = timeTill(till.toInt(), "\n", countInSeconds)
|
b.timeLeft.text = timeTill(till.toInt(), "\n", countInSeconds)
|
||||||
|
@ -232,6 +232,7 @@ class HomeTimetableCard(
|
|||||||
}
|
}
|
||||||
|
|
||||||
lessons = lessons.filter { it.type != Lesson.TYPE_NO_LESSONS }
|
lessons = lessons.filter { it.type != Lesson.TYPE_NO_LESSONS }
|
||||||
|
lessons.onEach { it.filterNotes() }
|
||||||
|
|
||||||
b.timetableLayout.visibility = View.VISIBLE
|
b.timetableLayout.visibility = View.VISIBLE
|
||||||
b.noTimetableLayout.visibility = View.GONE
|
b.noTimetableLayout.visibility = View.GONE
|
||||||
@ -344,6 +345,7 @@ class HomeTimetableCard(
|
|||||||
|
|
||||||
private val LessonFull?.subjectSpannable: CharSequence
|
private val LessonFull?.subjectSpannable: CharSequence
|
||||||
get() = if (this == null) "?" else when {
|
get() = if (this == null) "?" else when {
|
||||||
|
hasReplacingNotes() -> getNoteSubstituteText(showNotes = true) ?: "?"
|
||||||
isCancelled -> displaySubjectName?.asStrikethroughSpannable() ?: "?"
|
isCancelled -> displaySubjectName?.asStrikethroughSpannable() ?: "?"
|
||||||
isChange -> displaySubjectName?.asItalicSpannable() ?: "?"
|
isChange -> displaySubjectName?.asItalicSpannable() ?: "?"
|
||||||
else -> displaySubjectName ?: "?"
|
else -> displaySubjectName ?: "?"
|
||||||
|
@ -337,8 +337,11 @@ class WidgetTimetableProvider : AppWidgetProvider() {
|
|||||||
scrollPos = pos + 1
|
scrollPos = pos + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove notes from other profiles
|
||||||
|
lesson.filterNotes()
|
||||||
// set the subject and classroom name
|
// set the subject and classroom name
|
||||||
model.subjectName = lesson.displaySubjectName
|
model.subjectName = lesson.getNoteSubstituteText(showNotes = true)
|
||||||
|
?: lesson.displaySubjectName
|
||||||
model.classroomName = lesson.displayClassroom
|
model.classroomName = lesson.displayClassroom
|
||||||
|
|
||||||
// set the bell sync to calculate progress in ListProvider
|
// set the bell sync to calculate progress in ListProvider
|
||||||
|
@ -19,7 +19,7 @@ public class ItemWidgetTimetableModel {
|
|||||||
public Time endTime;
|
public Time endTime;
|
||||||
public boolean lessonPassed;
|
public boolean lessonPassed;
|
||||||
public boolean lessonCurrent;
|
public boolean lessonCurrent;
|
||||||
public String subjectName = "";
|
public CharSequence subjectName = "";
|
||||||
public String classroomName = "";
|
public String classroomName = "";
|
||||||
public boolean lessonChange = false;
|
public boolean lessonChange = false;
|
||||||
public boolean lessonChangeNoClassroom = false;
|
public boolean lessonChangeNoClassroom = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user