From c00afb1db0b8f00fb4ab81d995b922b99cdb34d4 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 24 Jan 2024 09:53:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/main/activity/MainActivity.java | 9 ++++++++- .../java/com/yunbao/main/views/MainHomeViewHolder.java | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 4655f2172..2b280ad62 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -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)); } }); diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java index 3996e16cb..aa91acf13 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java @@ -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;