diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt index cde53322..f0cab7f1 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceFragment.kt @@ -118,6 +118,10 @@ class AttendanceFragment : BaseSessionFragment(), AttendanceView, MainView.MainC attendanceProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + attendanceSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { attendanceRecycler.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt index 5825c318..988681b1 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendancePresenter.kt @@ -105,6 +105,7 @@ class AttendancePresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ @@ -128,6 +129,7 @@ class AttendancePresenter @Inject constructor( Timber.i("Reload attendance view with the date ${currentDate.toFormattedString()}") view?.apply { showProgress(true) + enableSwipe(false) showContent(false) showEmpty(false) clearData() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceView.kt index f839e89a..ef3b874b 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/AttendanceView.kt @@ -25,6 +25,8 @@ interface AttendanceView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showPreButton(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryFragment.kt index 8f36d746..b8d2c952 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryFragment.kt @@ -97,6 +97,10 @@ class AttendanceSummaryFragment : BaseSessionFragment(), AttendanceSummaryView, attendanceSummaryProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + attendanceSummarySwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { attendanceSummaryRecycler.visibility = if (show) VISIBLE else GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt index ab9ce151..54942c7f 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryPresenter.kt @@ -51,6 +51,7 @@ class AttendanceSummaryPresenter @Inject constructor( view?.run { showContent(false) showProgress(true) + enableSwipe(false) clearView() } (subjects.singleOrNull { it.name == name }?.realId ?: -1).let { diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryView.kt index af62a2de..e4c36db7 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/attendance/summary/AttendanceSummaryView.kt @@ -14,6 +14,8 @@ interface AttendanceSummaryView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showEmpty(show: Boolean) fun updateDataSet(data: List, header: AttendanceSummaryScrollableHeader) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamFragment.kt index c433f873..97e97727 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamFragment.kt @@ -99,6 +99,10 @@ class ExamFragment : BaseSessionFragment(), ExamView, MainView.MainChildView, Ma examProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + examSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { examRecycler.visibility = if (show) VISIBLE else GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamPresenter.kt index 0e99b001..4b6ef298 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamPresenter.kt @@ -92,6 +92,7 @@ class ExamPresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ @@ -122,6 +123,7 @@ class ExamPresenter @Inject constructor( Timber.i("Reload exam view with the date ${currentDate.toFormattedString()}") view?.apply { showProgress(true) + enableSwipe(false) showContent(false) showEmpty(false) clearData() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamView.kt index b6a926f3..2ced3f2d 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/exam/ExamView.kt @@ -23,6 +23,8 @@ interface ExamView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showNextButton(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsFragment.kt index ebeacf76..205cde77 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsFragment.kt @@ -125,6 +125,10 @@ class GradeDetailsFragment : BaseSessionFragment(), GradeDetailsView, GradeView. gradeDetailsProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + gradeDetailsSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { gradeDetailsRecycler.visibility = if (show) VISIBLE else INVISIBLE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsPresenter.kt index 9b1c7ead..1be0b36f 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsPresenter.kt @@ -97,6 +97,7 @@ class GradeDetailsPresenter @Inject constructor( fun onParentViewChangeSemester() { view?.run { showProgress(true) + enableSwipe(false) showRefresh(false) showContent(false) showEmpty(false) @@ -119,6 +120,7 @@ class GradeDetailsPresenter @Inject constructor( view?.run { showRefresh(false) showProgress(false) + enableSwipe(true) notifyParentDataLoaded(semesterId) } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsView.kt index 9ab92412..1fb98216 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/details/GradeDetailsView.kt @@ -38,6 +38,8 @@ interface GradeDetailsView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showRefresh(show: Boolean) fun notifyParentDataLoaded(semesterId: Int) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsFragment.kt index 9b7912d1..6e5bc8fa 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsFragment.kt @@ -149,6 +149,10 @@ class GradeStatisticsFragment : BaseSessionFragment(), GradeStatisticsView, Grad gradeStatisticsProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + gradeStatisticsSwipe.isEnabled = enable + } + override fun showRefresh(show: Boolean) { gradeStatisticsSwipe.isRefreshing = show } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt index c383ec8b..1e4e494c 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsPresenter.kt @@ -46,6 +46,7 @@ class GradeStatisticsPresenter @Inject constructor( fun onParentViewChangeSemester() { view?.run { showProgress(true) + enableSwipe(false) showRefresh(false) showContent(false) showEmpty(false) @@ -64,6 +65,7 @@ class GradeStatisticsPresenter @Inject constructor( view?.run { showContent(false) showProgress(true) + enableSwipe(false) showEmpty(false) clearView() } @@ -78,6 +80,7 @@ class GradeStatisticsPresenter @Inject constructor( view?.run { showContent(false) showProgress(true) + enableSwipe(false) showEmpty(false) clearView() } @@ -121,6 +124,7 @@ class GradeStatisticsPresenter @Inject constructor( view?.run { showRefresh(false) showProgress(false) + enableSwipe(true) notifyParentDataLoaded(semesterId) } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsView.kt index 59a71c00..e0649fc4 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/statistics/GradeStatisticsView.kt @@ -27,5 +27,7 @@ interface GradeStatisticsView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showRefresh(show: Boolean) } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryFragment.kt index 67e7d461..f174f96c 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryFragment.kt @@ -86,6 +86,10 @@ class GradeSummaryFragment : BaseSessionFragment(), GradeSummaryView, GradeView. gradeSummaryProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + gradeSummarySwipe.isEnabled = enable + } + override fun showRefresh(show: Boolean) { gradeSummarySwipe.isRefreshing = show } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryPresenter.kt index 61853f70..5dbf7513 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryPresenter.kt @@ -63,6 +63,7 @@ class GradeSummaryPresenter @Inject constructor( view?.run { showRefresh(false) showProgress(false) + enableSwipe(true) notifyParentDataLoaded(semesterId) } }.subscribe({ @@ -94,6 +95,7 @@ class GradeSummaryPresenter @Inject constructor( fun onParentViewChangeSemester() { view?.run { showProgress(true) + enableSwipe(false) showRefresh(false) showContent(false) showEmpty(false) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryView.kt index 2602ec99..5f7c7b16 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/grade/summary/GradeSummaryView.kt @@ -20,6 +20,8 @@ interface GradeSummaryView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showRefresh(show: Boolean) fun showContent(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkFragment.kt index f2240bf7..ab40027d 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkFragment.kt @@ -88,6 +88,10 @@ class HomeworkFragment : BaseSessionFragment(), HomeworkView, MainView.TitledVie homeworkProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + homeworkSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { homeworkRecycler.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkPresenter.kt index 036ebdc2..94e6f3cd 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkPresenter.kt @@ -77,6 +77,7 @@ class HomeworkPresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ @@ -99,6 +100,7 @@ class HomeworkPresenter @Inject constructor( Timber.i("Reload homework view with the date ${currentDate.toFormattedString()}") view?.apply { showProgress(true) + enableSwipe(false) showContent(false) showEmpty(false) clearData() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkView.kt index 521020e6..1452b66d 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/homework/HomeworkView.kt @@ -21,6 +21,8 @@ interface HomeworkView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showPreButton(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberFragment.kt index 201540f6..388af8d0 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberFragment.kt @@ -54,6 +54,10 @@ class LuckyNumberFragment : BaseSessionFragment(), LuckyNumberView, MainView.Tit luckyNumberProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + luckyNumberSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { luckyNumberContent.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberPresenter.kt index 56889012..afb8e332 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberPresenter.kt @@ -39,6 +39,7 @@ class LuckyNumberPresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberView.kt index eece5b70..5c19142c 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/luckynumber/LuckyNumberView.kt @@ -15,6 +15,8 @@ interface LuckyNumberView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun isViewEmpty(): Boolean diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt index 61572d72..eb5bbe67 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabFragment.kt @@ -91,6 +91,10 @@ class MessageTabFragment : BaseSessionFragment(), MessageTabView, MessageView.Me messageTabProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + messageTabSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { messageTabRecycler.visibility = if (show) VISIBLE else INVISIBLE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt index cef6e562..7d9fda0d 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabPresenter.kt @@ -47,6 +47,7 @@ class MessageTabPresenter @Inject constructor( view?.run { showRefresh(false) showProgress(false) + enableSwipe(true) notifyParentDataLoaded() } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabView.kt index 309e2766..bcda52b5 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/message/tab/MessageTabView.kt @@ -20,6 +20,8 @@ interface MessageTabView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showEmpty(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteFragment.kt index d5a2b0e6..fc773e10 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteFragment.kt @@ -86,6 +86,10 @@ class NoteFragment : BaseSessionFragment(), NoteView, MainView.TitledView { noteProgress.visibility = if (show) VISIBLE else GONE } + override fun enableSwipe(enable: Boolean) { + noteSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { noteRecycler.visibility = if (show) VISIBLE else GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NotePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NotePresenter.kt index a96bc7e0..32e2a4ad 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NotePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NotePresenter.kt @@ -46,6 +46,7 @@ class NotePresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } }.subscribe({ Timber.i("Loading note result: Success") diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteView.kt index c060c8ed..38e6c94f 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/note/NoteView.kt @@ -20,6 +20,8 @@ interface NoteView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun hideRefresh() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt index 1f83dc0a..3b1259f7 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableFragment.kt @@ -125,6 +125,10 @@ class TimetableFragment : BaseSessionFragment(), TimetableView, MainView.MainChi timetableProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + timetableSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { timetableRecycler.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt index a5c60e1e..3786a362 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetablePresenter.kt @@ -99,6 +99,7 @@ class TimetablePresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ @@ -121,6 +122,7 @@ class TimetablePresenter @Inject constructor( Timber.i("Reload timetable view with the date ${currentDate.toFormattedString()}") view?.apply { showProgress(true) + enableSwipe(false) showContent(false) showEmpty(false) clearData() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableView.kt index ac01d221..c08961c3 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/TimetableView.kt @@ -27,6 +27,8 @@ interface TimetableView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showPreButton(show: Boolean) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt index 2ccd15ea..bb328c41 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsFragment.kt @@ -92,6 +92,10 @@ class CompletedLessonsFragment : BaseSessionFragment(), CompletedLessonsView, Ma completedLessonsProgress.visibility = if (show) View.VISIBLE else View.GONE } + override fun enableSwipe(enable: Boolean) { + completedLessonsSwipe.isEnabled = enable + } + override fun showContent(show: Boolean) { completedLessonsRecycler.visibility = if (show) View.VISIBLE else View.GONE } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsPresenter.kt index 6fdfa130..ddc81818 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsPresenter.kt @@ -83,6 +83,7 @@ class CompletedLessonsPresenter @Inject constructor( view?.run { hideRefresh() showProgress(false) + enableSwipe(true) } } .subscribe({ @@ -105,6 +106,7 @@ class CompletedLessonsPresenter @Inject constructor( Timber.i("Reload completed lessons view with the date ${currentDate.toFormattedString()}") view?.apply { showProgress(true) + enableSwipe(false) showContent(false) showEmpty(false) clearData() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsView.kt index 0dc52362..9607cc47 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/timetable/completed/CompletedLessonsView.kt @@ -23,6 +23,8 @@ interface CompletedLessonsView : BaseSessionView { fun showProgress(show: Boolean) + fun enableSwipe(enable: Boolean) + fun showContent(show: Boolean) fun showPreButton(show: Boolean)