优化-待测试

This commit is contained in:
2025-12-01 11:20:44 +08:00
parent ec8eef83e8
commit 7a446001cf
@@ -384,14 +384,14 @@ class FoodCollectionActivity : ComponentActivity() {
) { records -> ) { records ->
finishRefresh() finishRefresh()
binding.etGoodsInput.hideKeyboard() binding.etGoodsInput.hideKeyboard()
if (pageNo == 1 && records.isEmpty()) {
loadEmptyView()
return@searchGoods
}
if (pageNo == 1) { if (pageNo == 1) {
searchGoodsList.clear() searchGoodsList.clear()
} }
searchGoodsList.addAll(records) searchGoodsList.addAll(records)
if (pageNo == 1 && searchGoodsList.isEmpty()) {
loadEmptyView()
return@searchGoods
}
val enableLoadMore = records.size >= PAGE_SIZE val enableLoadMore = records.size >= PAGE_SIZE
binding.refreshLayout.setEnableLoadMore(enableLoadMore) binding.refreshLayout.setEnableLoadMore(enableLoadMore)
if (enableLoadMore) { if (enableLoadMore) {