Sort lessons by number (#174)

This commit is contained in:
Mikołaj Pich 2018-10-30 22:07:44 +01:00 committed by Rafał Borcz
parent 0a7f09077f
commit ab71dd3fde
2 changed files with 2 additions and 0 deletions

View File

@ -67,6 +67,7 @@ class AttendancePresenter @Inject constructor(
else list.filter { !it.presence }
}
.map { items -> items.map { AttendanceItem(it) } }
.map { items -> items.sortedBy { it.attendance.number } }
.subscribeOn(schedulers.backgroundThread)
.observeOn(schedulers.mainThread)
.doFinally {

View File

@ -61,6 +61,7 @@ class TimetablePresenter @Inject constructor(
.map { it.single { semester -> semester.current } }
.flatMap { timetableRepository.getTimetable(it, currentDate, currentDate, forceRefresh) }
.map { items -> items.map { TimetableItem(it, view?.roomString.orEmpty()) } }
.map { items -> items.sortedBy { it.lesson.number } }
.subscribeOn(schedulers.backgroundThread)
.observeOn(schedulers.mainThread)
.doFinally {