fix [Banner错误展示]

This commit is contained in:
zlzw 2024-03-29 14:25:53 +08:00
parent 3f717131cc
commit bc412a0fb5
2 changed files with 14 additions and 4 deletions

View File

@ -345,24 +345,30 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (mMainHomeCommunityViewHolder != null) { if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo(); mMainHomeCommunityViewHolder.onPauseVideo();
} }
floatBanner.setVisibility(View.GONE);
break; break;
case 1: case 1:
MobclickAgent.onEvent(mContext, "community", "直播"); MobclickAgent.onEvent(mContext, "community", "直播");
if (mMainHomeCommunityViewHolder != null) { if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onResumePlay(); mMainHomeCommunityViewHolder.onResumePlay();
} }
if (anchorRecommendModel != null && anchorRecommendModel.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
}
break; break;
case 2: case 2:
MobclickAgent.onEvent(mContext, "information", "消息"); MobclickAgent.onEvent(mContext, "information", "消息");
if (mMainHomeCommunityViewHolder != null) { if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo(); mMainHomeCommunityViewHolder.onPauseVideo();
} }
floatBanner.setVisibility(View.GONE);
break; break;
case 3: case 3:
MobclickAgent.onEvent(mContext, "my", "我的"); MobclickAgent.onEvent(mContext, "my", "我的");
if (mMainHomeCommunityViewHolder != null) { if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo(); mMainHomeCommunityViewHolder.onPauseVideo();
} }
floatBanner.setVisibility(View.GONE);
break; break;
} }
if (mTabButtonGroup.getCurPosition() != position) { if (mTabButtonGroup.getCurPosition() != position) {
@ -627,6 +633,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
AnchorRecommendModel anchorRecommendModel;
/** /**
* 首页推荐位 * 首页推荐位
*/ */
@ -640,6 +648,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Override @Override
public void onSuccess(AnchorRecommendModel data) { public void onSuccess(AnchorRecommendModel data) {
if (isFinishing()) return; if (isFinishing()) return;
anchorRecommendModel = data;
if (data.getListShow() == 1 && data.getList().size() > 2) { if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE); floatBanner.setVisibility(View.VISIBLE);
findViewById(R.id.banner_click).setVisibility(View.VISIBLE); findViewById(R.id.banner_click).setVisibility(View.VISIBLE);
@ -1355,7 +1364,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
mTabButtonGroup.setCurPosition(event.getPage()); mTabButtonGroup.setCurPosition(event.getPage());
if (event.getPage() == 0) { if (event.getPage() == 0) {
isfloatBannernet = true; isfloatBannernet = true;
initAnchorRecommendBanner(); //initAnchorRecommendBanner();
} else { } else {
isfloatBannernet = false; isfloatBannernet = false;
floatBanner.setVisibility(View.GONE); floatBanner.setVisibility(View.GONE);
@ -1515,9 +1524,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (event.isFloatWarOrder()) { if (event.isFloatWarOrder()) {
floatWarOrder.setVisibility(View.GONE); floatWarOrder.setVisibility(View.GONE);
} else { } else {
if (anchorRecommendModel != null && anchorRecommendModel.getShowWarOrder() == 1) {
floatWarOrder.setVisibility(View.VISIBLE); floatWarOrder.setVisibility(View.VISIBLE);
} }
} }
}
private void initRedPacket() { private void initRedPacket() {
ImageView title = floatRedPacket.findViewById(R.id.title); ImageView title = floatRedPacket.findViewById(R.id.title);

View File

@ -136,10 +136,9 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
search = findViewById(R.id.search); search = findViewById(R.id.search);
contacts.setOnClickListener(view -> { contacts.setOnClickListener(view -> {
//通讯录 //通讯录
//RouteUtil.forwardActivity(RouteUtil.PATH_ADDRESSBOOK); RouteUtil.forwardActivity(RouteUtil.PATH_ADDRESSBOOK);
// mContext.startActivity(new Intent(mContext, com.yunbao.main.activity.CompleteUserInfoActivity.class)); // mContext.startActivity(new Intent(mContext, com.yunbao.main.activity.CompleteUserInfoActivity.class));
// mContext.startActivity(new Intent(mContext, MessageHiConfigRecordActivity.class)); // mContext.startActivity(new Intent(mContext, MessageHiConfigRecordActivity.class));
ToastUtil.show(WordUtil.isNewZh()+"");
}); });
search.addTextChangedListener(new TextWatcher() { search.addTextChangedListener(new TextWatcher() {
@Override @Override