fix: 修复消息界面加载更多失效

This commit is contained in:
HuanCheng65 2022-12-31 15:15:33 +08:00
parent b2b85bfcda
commit 95afb6954a
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
2 changed files with 10 additions and 4 deletions

View File

@ -48,7 +48,6 @@
android:name=".App"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="@xml/backup_descriptor"
android:icon="@mipmap/ic_launcher_new"
android:label="@string/app_name"

View File

@ -186,9 +186,16 @@ class MessageFragment : BaseFragment(), Refreshable, OnTabSelectedListener,
} else {
adapter.addData(it)
}
smartRefreshLayout.finishRefresh(true)
if (it.page?.hasMore != "1") {
smartRefreshLayout.finishRefreshWithNoMoreData()
if (reload) {
smartRefreshLayout.finishRefresh(true)
if (it.page?.hasMore != "1") {
smartRefreshLayout.finishRefreshWithNoMoreData()
}
} else {
smartRefreshLayout.finishLoadMore(true)
if (it.page?.hasMore != "1") {
smartRefreshLayout.finishLoadMoreWithNoMoreData()
}
}
}.doIfFailure {
if (reload) {