房间列表上拉加载

This commit is contained in:
2025-12-11 09:19:54 +08:00
parent b6bc353db1
commit ecdd2fc063
3 changed files with 12 additions and 21 deletions

View File

@@ -150,17 +150,17 @@ public class HotListFragment extends BaseMvpFragment<HotListPresenter, FragmentH
} else {
// 检查是否有重复数据
boolean hasDuplicate = false;
List<TopRoom> currentData = mAdapter.getData();
if (!currentData.isEmpty() && !data.isEmpty()) {
// 检查第一条数据是否已经存在
TopRoom firstNewData = data.get(0);
for (TopRoom item : currentData) {
if (item.getRoom_id().equals(firstNewData.getRoom_id())) {
hasDuplicate = true;
break;
}
}
}
// List<TopRoom> currentData = mAdapter.getData();
// if (!currentData.isEmpty() && !data.isEmpty()) {
// // 检查第一条数据是否已经存在
// TopRoom firstNewData = data.get(0);
// for (TopRoom item : currentData) {
// if (item.getRoom_id().equals(firstNewData.getRoom_id())) {
// hasDuplicate = true;
// break;
// }
// }
// }
if (!hasDuplicate) {
mAdapter.addData(data); // 加载更多时添加数据