Remove unneeded swipe refresh

This commit is contained in:
len
2016-06-05 11:54:35 +02:00
parent 6687c80b2d
commit 156e43290e
3 changed files with 3 additions and 46 deletions

View File

@ -123,9 +123,6 @@ class RecentChaptersFragment : BaseRxFragment<RecentChaptersPresenter>(), Action
adapter = RecentChaptersAdapter(this)
recycler.adapter = adapter
// Set swipe refresh listener
swipe_refresh.setOnRefreshListener { fetchChapters() }
// Update toolbar text
setToolbarTitle(R.string.label_recent_updates)
}
@ -316,28 +313,4 @@ class RecentChaptersFragment : BaseRxFragment<RecentChaptersPresenter>(), Action
(childFragmentManager.findFragmentByTag(DeletingChaptersDialog.TAG) as? DialogFragment)?.dismiss()
}
/**
* Called when swipe refresh activated.
*/
fun fetchChapters() {
swipe_refresh.isRefreshing = true
presenter.fetchChaptersFromSource()
}
/**
* Called after refresh is completed
*/
fun onFetchChaptersDone() {
swipe_refresh.isRefreshing = false
}
/**
* Called when something went wrong while refreshing
* @param error information on what went wrong
*/
fun onFetchChaptersError(error: Throwable) {
swipe_refresh.isRefreshing = false
context.toast(error.message)
}
}

View File

@ -65,11 +65,7 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
fragment.onNextMangaChapters(chapters)
// Update download status
updateChapterStatus(convertToMangaChaptersList(chapters))
// Stop refresh
fragment.onFetchChaptersDone()
},
{ fragment, error -> fragment.onFetchChaptersError(error) }
}
)
// Used to update download status
@ -346,8 +342,5 @@ class RecentChaptersPresenter : BasePresenter<RecentChaptersFragment>() {
chapter.status = Download.NOT_DOWNLOADED
}
fun fetchChaptersFromSource() {
start(GET_RECENT_CHAPTERS)
}
}