forked from github/wulkanowy-mirror
Disable swipe to refresh on data loading (#270)
This commit is contained in:
parent
f21feabc49
commit
f773310cdb
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -25,6 +25,8 @@ interface AttendanceView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showPreButton(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -14,6 +14,8 @@ interface AttendanceSummaryView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showEmpty(show: Boolean)
|
||||
|
||||
fun updateDataSet(data: List<AttendanceSummaryItem>, header: AttendanceSummaryScrollableHeader)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -23,6 +23,8 @@ interface ExamView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showNextButton(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ interface GradeDetailsView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showRefresh(show: Boolean)
|
||||
|
||||
fun notifyParentDataLoaded(semesterId: Int)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -27,5 +27,7 @@ interface GradeStatisticsView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showRefresh(show: Boolean)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -20,6 +20,8 @@ interface GradeSummaryView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showRefresh(show: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -21,6 +21,8 @@ interface HomeworkView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showPreButton(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class LuckyNumberPresenter @Inject constructor(
|
||||
view?.run {
|
||||
hideRefresh()
|
||||
showProgress(false)
|
||||
enableSwipe(true)
|
||||
}
|
||||
}
|
||||
.subscribe({
|
||||
|
@ -15,6 +15,8 @@ interface LuckyNumberView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun isViewEmpty(): Boolean
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ class MessageTabPresenter @Inject constructor(
|
||||
view?.run {
|
||||
showRefresh(false)
|
||||
showProgress(false)
|
||||
enableSwipe(true)
|
||||
notifyParentDataLoaded()
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ interface MessageTabView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showEmpty(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ class NotePresenter @Inject constructor(
|
||||
view?.run {
|
||||
hideRefresh()
|
||||
showProgress(false)
|
||||
enableSwipe(true)
|
||||
}
|
||||
}.subscribe({
|
||||
Timber.i("Loading note result: Success")
|
||||
|
@ -20,6 +20,8 @@ interface NoteView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun hideRefresh()
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -27,6 +27,8 @@ interface TimetableView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showPreButton(show: Boolean)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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()
|
||||
|
@ -23,6 +23,8 @@ interface CompletedLessonsView : BaseSessionView {
|
||||
|
||||
fun showProgress(show: Boolean)
|
||||
|
||||
fun enableSwipe(enable: Boolean)
|
||||
|
||||
fun showContent(show: Boolean)
|
||||
|
||||
fun showPreButton(show: Boolean)
|
||||
|
Loading…
x
Reference in New Issue
Block a user