fix:修复欢乐砸蛋排行榜数据加载问题(viewpager2导致)

This commit is contained in:
max
2024-04-23 14:21:17 +08:00
parent 681bd8bca9
commit d9a39877f1

View File

@@ -42,6 +42,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
private BoxRankingListAdapter mAdapter;
private int datetype;
private boolean isInitiated = false;
public static BoxRankingFragment newInstance(int datetype) {
Bundle args = new Bundle();
args.putInt("datetype", datetype);
@@ -81,9 +82,16 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
@Override
public void initiate() {
initRecyclerView();
loadData(true, datetype);
}
@Override
public void onResume() {
super.onResume();
if(!isInitiated){
loadData(true, datetype);
}
isInitiated = true;
}
/**
* 刷新数据
@@ -153,6 +161,7 @@ public class BoxRankingFragment extends BaseMvpFragment<IBoxRankingView, BoxRank
if (page <= 1) {
showNoData(getString(R.string.empty_data));
}
mAdapter.loadMoreEnd();
}
@Override