房间列表上拉加载
This commit is contained in:
@@ -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); // 加载更多时添加数据
|
||||
|
||||
Reference in New Issue
Block a user