测试修复首页闪屏问题

This commit is contained in:
zlzw 2024-10-11 16:39:58 +08:00
parent 381d906bdc
commit a40ba0ceb1
2 changed files with 7 additions and 1 deletions

View File

@ -416,6 +416,10 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
mRecyclerView.addItemDecoration(gridSpacingItemDecoration); mRecyclerView.addItemDecoration(gridSpacingItemDecoration);
} }
public RecyclerView getRefreshView() {
return mRecyclerView;
}
public interface DataHelperNew { public interface DataHelperNew {
void loadData(int p); void loadData(int p);

View File

@ -189,7 +189,7 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
Log.i("t2", "aaa" + p); Log.i("t2", "aaa" + p);
if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) { if (TextUtils.equals(typeHot, "Hot") || TextUtils.equals(typeHot, "hot") || TextUtils.equals(typeHot, "熱門")) {
pp = 1; pp = 1;
MainHttpUtil.getHot(p, callback); // MainHttpUtil.getHot(p, callback);
LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() { LiveHttpUtil.getAnchorLastWeekList(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
@ -331,6 +331,8 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
if (!canClick()) { if (!canClick()) {
return; return;
} }
mRefreshView.getRefreshView().scrollToPosition(0);
mAdapter.clearData();
select = bean.getId(); select = bean.getId();
typeHot = bean.getEnglish(); typeHot = bean.getEnglish();
mRefreshView.initData(); mRefreshView.initData();