fix: 修复吧页面“回到顶部”无反应

This commit is contained in:
HuanCheng65 2022-08-26 21:04:41 +08:00
parent f84be23f61
commit 31bb6b9815
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
2 changed files with 5 additions and 3 deletions

View File

@ -496,9 +496,9 @@ class ForumActivity : BaseActivity(), View.OnClickListener, OnRefreshedListener,
refresh()
}
"back_to_top" -> {
mAdapter?.currentFragment?.apply {
mAdapter?.getItem(headerTabView.selectedTabPosition)?.apply {
if (this is ScrollTopable) {
scrollToTop()
this.scrollToTop()
}
}
}

View File

@ -253,7 +253,9 @@ class ForumFragment : BaseFragment(), Refreshable, OnSwitchListener, ScrollTopab
}
override fun scrollToTop() {
virtualLayoutManager.scrollToPosition(0)
mRecyclerView.post {
virtualLayoutManager.scrollToPosition(0)
}
}
interface OnRefreshedListener {