[UI/Timetable] Fix non-null cast exception.

This commit is contained in:
Kuba Szczodrzyński 2019-12-02 22:20:53 +01:00
parent 8f8d613f6e
commit 5d3de35c10

View File

@ -120,7 +120,7 @@ class TimetableDayFragment : Fragment(), CoroutineScope {
private fun processLessonList(lessons: List<LessonFull>, events: List<EventFull>) {
// no lessons - timetable not downloaded yet
if (lessons.isEmpty()) {
inflater.inflate(R.layout.timetable_no_timetable, view as FrameLayout) { view, _, parent ->
inflater.inflate(R.layout.timetable_no_timetable, view as FrameLayout?) { view, _, parent ->
parent?.removeAllViews()
parent?.addView(view)
val b = TimetableNoTimetableBinding.bind(view)
@ -143,7 +143,7 @@ class TimetableDayFragment : Fragment(), CoroutineScope {
}
// one lesson indicating a day without lessons
if (lessons.size == 1 && lessons[0].type == Lesson.TYPE_NO_LESSONS) {
inflater.inflate(R.layout.timetable_no_lessons, view as FrameLayout) { view, _, parent ->
inflater.inflate(R.layout.timetable_no_lessons, view as FrameLayout?) { view, _, parent ->
parent?.removeAllViews()
parent?.addView(view)
}