This commit is contained in:
18401019693 2024-01-24 09:53:13 +08:00
parent dfca615735
commit c00afb1db0
2 changed files with 17 additions and 1 deletions

View File

@ -633,11 +633,17 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
((TextView) floatRedPacket.findViewById(R.id.progressText)).setText(data.getRedPacketNum() + "/" + data.getRedPacketTotal());
}
if (data.getShowWarOrder() == 0) {
floatWarOrder.setVisibility(View.GONE);
floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
} else {
floatWarOrder.setVisibility(View.VISIBLE);
if (mainHomeViewHolder!=null&&mainHomeViewHolder.isFloatWarOrder()){
floatWarOrder.setVisibility(View.GONE);
}else {
floatWarOrder.setVisibility(View.VISIBLE);
}
floatBanner.setVisibility(View.GONE);
findViewById(R.id.banner_click).setVisibility(View.GONE);
}
@ -645,6 +651,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override
public void onError(String error) {
ToastUtil.show(mContext.getString(R.string.net_error));
}
});

View File

@ -25,6 +25,11 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
private MainHomeGameViewHolder mainHomeGameLiveViewHolder;
private final String mPageName = "home_page";
private ImageView img_trophy;
private boolean floatWarOrder;
public boolean isFloatWarOrder() {
return floatWarOrder;
}
public MainHomeViewHolder(Context context, ViewGroup parentView) {
super(context, parentView);
@ -60,18 +65,22 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
protected void loadPageData(int position) {
switch (position) {
case 0:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_follow", "首页关注列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 1:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_hot", "首页热门列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 2:
floatWarOrder = false;
MobclickAgent.onEvent(mContext, "home_page_recommend", "首页推荐列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(false));
break;
case 3:
floatWarOrder = true;
MobclickAgent.onEvent(mContext, "home_page_redpk", "首页红包列表按钮");
EventBus.getDefault().post(new FloatWarOrderEvent().setFloatWarOrder(true));
break;