修改活动导致星级出现展示不出来的问题

This commit is contained in:
18401019693 2022-10-18 15:12:25 +08:00
parent 94c5f4b809
commit baa596158d
2 changed files with 127 additions and 126 deletions

View File

@ -1045,22 +1045,25 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}); });
} }
public void showStart(StarChallengeStatusModel data) { public synchronized void showStart(StarChallengeStatusModel data) {
boolean upData = false; boolean upData = false;
if (mBannerList2 == null || mBannerList2.size() == 0) { if (mBannerList2 != null && mBannerList2.size() == 0) {
mBannerList2 = new ArrayList<>(); Log.e("PortraitLiveManager", "直接添加星级任务");
BannerBean bannerBean = new BannerBean(); BannerBean bannerBean = new BannerBean();
bannerBean.setStart(true); bannerBean.setStart(true);
bannerBean.setModel(data); bannerBean.setModel(data);
mBannerList2.add(bannerBean); mBannerList2.add(bannerBean);
} else { } else {
Log.e("PortraitLiveManager", "遍历添加星级任务");
for (BannerBean bean : mBannerList2) { for (BannerBean bean : mBannerList2) {
if (bean.isStart()) { if (bean.isStart()) {
Log.e("PortraitLiveManager", "更新添加星级任务");
bean.setModel(data); bean.setModel(data);
upData = true; upData = true;
} }
} }
if (!upData) { if (!upData) {
Log.e("PortraitLiveManager", "更新添加星级任务2");
BannerBean bannerBean = new BannerBean(); BannerBean bannerBean = new BannerBean();
bannerBean.setStart(true); bannerBean.setStart(true);
bannerBean.setModel(data); bannerBean.setModel(data);
@ -1082,127 +1085,128 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
msgLayout.setVisibility(View.GONE); msgLayout.setVisibility(View.GONE);
} }
private void showBanner2() { private synchronized void showBanner2() {
if (mBannerList2 == null || mBannerList2.size() == 0 || mBanner2 == null) { Log.e("PortraitLiveManager", "加载不了 mBannerList2 == null " + (mBannerList2 == null));
Log.e("PortraitLiveManager", "加载不了"); Log.e("PortraitLiveManager", "加载不了 mBannerList2.size() == 0 " + (mBannerList2.size() == 0));
return; Log.e("PortraitLiveManager", "加载不了 mBanner2 == null " + (mBanner2 == null));
} if (mBannerList2 != null && mBanner2 != null) {
btn_event2.setVisibility(View.VISIBLE); btn_event2.setVisibility(View.VISIBLE);
if (mBannerList2.size() == 1) {
if (mBannerList2.size() == 1) { Log.e("PortraitLiveManager", "加载一个的");
mBanner2.setAutoPlay(false)
mBanner2.setAutoPlay(false) .setPages(mBannerList2, new CustomViewHolder())
.setPages(mBannerList2, new CustomViewHolder()) .setDelayTime(3000)
.setDelayTime(3000) .setBannerStyle(BannerConfig.NOT_INDICATOR)
.setBannerStyle(BannerConfig.NOT_INDICATOR) .setOnBannerClickListener(new OnBannerClickListener() {
.setOnBannerClickListener(new OnBannerClickListener() { @Override
@Override public void onBannerClick(List datas, int p) {
public void onBannerClick(List datas, int p) { if (mBannerList2 != null) {
if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) {
if (p >= 0 && p < mBannerList2.size()) { IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); BannerBean bean = mBannerList2.get(p);
BannerBean bean = mBannerList2.get(p); String type = "";
String type = ""; StringBuffer htmlUrl = new StringBuffer();
StringBuffer htmlUrl = new StringBuffer(); //判断是否是星级活动
//判断是否是星级活动 if (bean.isStart()) {
if (bean.isStart()) { type = bean.getModel().getType();
type = bean.getModel().getType(); htmlUrl.append(CommonAppConfig.HOST)
htmlUrl.append(CommonAppConfig.HOST) .append("/")
.append("/") .append(bean.getModel().getActivityUrl())
.append(bean.getModel().getActivityUrl()) .append("&nickname=")
.append("&nickname=") .append(userInfo.getUserNicename())
.append(userInfo.getUserNicename()) .append("&token=")
.append("&token=") .append(userInfo.getToken())
.append(userInfo.getToken()) .append("&anchorUid=")
.append("&anchorUid=") .append(mLiveUid)
.append(mLiveUid) .append("&uid=")
.append("&uid=") .append(userInfo.getId())
.append(userInfo.getId()) .append("&k=")
.append("&k=") .append(System.currentTimeMillis());
.append(System.currentTimeMillis()); } else {
} else { type = bean.getShow_type();
type = bean.getShow_type(); htmlUrl.append(bean.getLink())
htmlUrl.append(bean.getLink()) .append("?uid=")
.append("?uid=") .append(userInfo.getId())
.append(userInfo.getId()) .append("&token=")
.append("&token=") .append(userInfo.getToken())
.append(userInfo.getToken()) .append("&anchorUid=")
.append("&anchorUid=") .append(mLiveUid)
.append(mLiveUid) .append("&t=")
.append("&t=") .append(System.currentTimeMillis());
.append(System.currentTimeMillis()); }
} if (TextUtils.equals(type, "1")) {
if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else {
} else { Bundle bundle = new Bundle();
Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString());
bundle.putString("url", htmlUrl.toString()); LiveHDDialogFragment fragment = new LiveHDDialogFragment();
LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle);
fragment.setArguments(bundle); fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); }
} }
} }
} }
} })
}) .start();
.start(); } else {
} else { mBanner2.setAutoPlay(true)
mBanner2.setAutoPlay(true) .setPages(mBannerList2, new CustomViewHolder())
.setPages(mBannerList2, new CustomViewHolder()) .setDelayTime(3000)
.setDelayTime(3000) .setBannerStyle(BannerConfig.NOT_INDICATOR)
.setBannerStyle(BannerConfig.NOT_INDICATOR) .setOnBannerClickListener(new OnBannerClickListener() {
.setOnBannerClickListener(new OnBannerClickListener() { @Override
@Override public void onBannerClick(List datas, int p) {
public void onBannerClick(List datas, int p) { if (mBannerList2 != null) {
if (mBannerList2 != null) { if (p >= 0 && p < mBannerList2.size()) {
if (p >= 0 && p < mBannerList2.size()) { IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); BannerBean bean = mBannerList2.get(p);
BannerBean bean = mBannerList2.get(p); String type = "";
String type = ""; StringBuffer htmlUrl = new StringBuffer();
StringBuffer htmlUrl = new StringBuffer(); //判断是否是星级活动
//判断是否是星级活动 if (bean.isStart()) {
if (bean.isStart()) { type = bean.getModel().getType();
type = bean.getModel().getType(); htmlUrl.append(CommonAppConfig.HOST)
htmlUrl.append(CommonAppConfig.HOST) .append("/")
.append("/") .append(bean.getModel().getActivityUrl())
.append(bean.getModel().getActivityUrl()) .append("&nickname=")
.append("&nickname=") .append(userInfo.getUserNicename())
.append(userInfo.getUserNicename()) .append("&token=")
.append("&token=") .append(userInfo.getToken())
.append(userInfo.getToken()) .append("&anchorUid=")
.append("&anchorUid=") .append(mLiveUid)
.append(mLiveUid) .append("&uid=")
.append("&uid=") .append(userInfo.getId())
.append(userInfo.getId()) .append("&k=")
.append("&k=") .append(System.currentTimeMillis());
.append(System.currentTimeMillis()); } else {
} else { type = bean.getShow_type();
type = bean.getShow_type(); htmlUrl.append(bean.getLink())
htmlUrl.append(bean.getLink()) .append("?uid=")
.append("?uid=") .append(userInfo.getId())
.append(userInfo.getId()) .append("&token=")
.append("&token=") .append(userInfo.getToken())
.append(userInfo.getToken()) .append("&anchorUid=")
.append("&anchorUid=") .append(mLiveUid)
.append(mLiveUid) .append("&t=")
.append("&t=") .append(System.currentTimeMillis());
.append(System.currentTimeMillis()); }
} if (TextUtils.equals(type, "1")) {
if (TextUtils.equals(type, "1")) { ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false);
ZhuangBanActivity.forward(mContext, htmlUrl.toString(), false); } else {
} else { Bundle bundle = new Bundle();
Bundle bundle = new Bundle(); bundle.putString("url", htmlUrl.toString());
bundle.putString("url", htmlUrl.toString()); LiveHDDialogFragment fragment = new LiveHDDialogFragment();
LiveHDDialogFragment fragment = new LiveHDDialogFragment(); fragment.setArguments(bundle);
fragment.setArguments(bundle); fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); }
} }
} }
} }
} })
}) .start();
.start(); }
} }
} }
/** /**
@ -1231,14 +1235,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mBannerList2.add(bannerBean); mBannerList2.add(bannerBean);
} }
} }
if (mBannerList2.isEmpty()) { if (mBannerList2.size() > 0) {
btn_event2.setVisibility(View.GONE); if (mBanner2.isStart()) {
mBanner2.setVisibility(View.GONE); mBanner2.update(mBannerList2);
} } else {
showBanner2(); showBanner2();
} else { }
if (btn_event2 != null) {
btn_event2.setVisibility(View.GONE);
} }
} }
} }

View File

@ -303,7 +303,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE); LiveHttpUtil.cancel(LiveHttpConsts.ROOM_CHARGE);
CommonHttpUtil.cancel(CommonHttpConsts.GET_BALANCE); CommonHttpUtil.cancel(CommonHttpConsts.GET_BALANCE);
CommonHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST); CommonHttpUtil.cancel(LiveHttpConsts.GET_WISH_LIST);
CommonHttpUtil.cancel("StarChallengeStatus");
IMLoginManager.get(mContext).setisNewUserOne(false); IMLoginManager.get(mContext).setisNewUserOne(false);
//子线程执行退出操作 //子线程执行退出操作
exitLiveRoom(); exitLiveRoom();