Fixed swipe refresh not showing sometimes while browsing

This commit is contained in:
Jay 2020-04-26 19:11:05 -04:00
parent caaddda040
commit 67e9d79a1a

View file

@ -211,8 +211,6 @@ class MangaDetailsController : BaseController,
presenter.onCreate() presenter.onCreate()
swipe_refresh.isRefreshing = presenter.isLoading swipe_refresh.isRefreshing = presenter.isLoading
if (manga?.initialized != true)
swipe_refresh.post { swipe_refresh.isRefreshing = true }
swipe_refresh.setOnRefreshListener { presenter.refreshAll() } swipe_refresh.setOnRefreshListener { presenter.refreshAll() }
} }
@ -551,6 +549,16 @@ class MangaDetailsController : BaseController,
} }
} }
override fun onChangeEnded(
changeHandler: ControllerChangeHandler,
type: ControllerChangeType
) {
super.onChangeEnded(changeHandler, type)
if (type == ControllerChangeType.PUSH_ENTER) {
swipe_refresh?.isRefreshing = presenter.isLoading
}
}
override fun handleBack(): Boolean { override fun handleBack(): Boolean {
if (manga_cover_full?.visibility == View.VISIBLE) { if (manga_cover_full?.visibility == View.VISIBLE) {
manga_cover_full?.performClick() manga_cover_full?.performClick()