forked from github/wulkanowy-mirror
Fix date in attendance and timetable when day is changing (#1893)
This commit is contained in:
parent
bfab265ccf
commit
0a2eb07844
@ -91,15 +91,19 @@ class AttendancePresenter @Inject constructor(
|
||||
|
||||
fun onViewReselected() {
|
||||
Timber.i("Attendance view is reselected")
|
||||
view?.also { view ->
|
||||
view?.let { view ->
|
||||
if (view.currentStackSize == 1) {
|
||||
baseDate.also {
|
||||
if (currentDate != it) {
|
||||
reloadView(it)
|
||||
loadData()
|
||||
} else if (!view.isViewEmpty) view.resetView()
|
||||
baseDate = now().previousOrSameSchoolDay
|
||||
|
||||
if (currentDate != baseDate) {
|
||||
reloadView(baseDate)
|
||||
loadData()
|
||||
} else if (!view.isViewEmpty) {
|
||||
view.resetView()
|
||||
}
|
||||
} else view.popView()
|
||||
} else {
|
||||
view.popView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,15 +87,19 @@ class TimetablePresenter @Inject constructor(
|
||||
|
||||
fun onViewReselected() {
|
||||
Timber.i("Timetable view is reselected")
|
||||
view?.also { view ->
|
||||
view?.let { view ->
|
||||
if (view.currentStackSize == 1) {
|
||||
baseDate.also {
|
||||
if (currentDate != it) {
|
||||
reloadView(it)
|
||||
loadData()
|
||||
} else if (!view.isViewEmpty) view.resetView()
|
||||
baseDate = now().nextOrSameSchoolDay
|
||||
|
||||
if (currentDate != baseDate) {
|
||||
reloadView(baseDate)
|
||||
loadData()
|
||||
} else if (!view.isViewEmpty) {
|
||||
view.resetView()
|
||||
}
|
||||
} else view.popView()
|
||||
} else {
|
||||
view.popView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user