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) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
floatBanner.setVisibility(View.GONE);
break;
case 1:
MobclickAgent.onEvent(mContext, "community", "直播");
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onResumePlay();
}
if (anchorRecommendModel != null && anchorRecommendModel.getList().size() > 2) {
floatBanner.setVisibility(View.VISIBLE);
}
break;
case 2:
MobclickAgent.onEvent(mContext, "information", "消息");
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
floatBanner.setVisibility(View.GONE);
break;
case 3:
MobclickAgent.onEvent(mContext, "my", "我的");
if (mMainHomeCommunityViewHolder != null) {
mMainHomeCommunityViewHolder.onPauseVideo();
}
floatBanner.setVisibility(View.GONE);
break;
}
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
public void onSuccess(AnchorRecommendModel data) {
if (isFinishing()) return;
anchorRecommendModel = data;
if (data.getListShow() == 1 && data.getList().size() > 2) {
floatBanner.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());
if (event.getPage() == 0) {
isfloatBannernet = true;
initAnchorRecommendBanner();
//initAnchorRecommendBanner();
} else {
isfloatBannernet = false;
floatBanner.setVisibility(View.GONE);
@ -1515,7 +1524,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
if (event.isFloatWarOrder()) {
floatWarOrder.setVisibility(View.GONE);
} else {
floatWarOrder.setVisibility(View.VISIBLE);
if (anchorRecommendModel != null && anchorRecommendModel.getShowWarOrder() == 1) {
floatWarOrder.setVisibility(View.VISIBLE);
}
}
}

View File

@ -136,10 +136,9 @@ public class MainMessageViewHolder extends AbsMainViewHolder {
search = findViewById(R.id.search);
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, MessageHiConfigRecordActivity.class));
ToastUtil.show(WordUtil.isNewZh()+"");
});
search.addTextChangedListener(new TextWatcher() {
@Override