优化-待测试
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user