心愿单修改,

This commit is contained in:
18401019693
2023-04-06 14:20:46 +08:00
parent 028f2794bf
commit 3bf6518e25
5 changed files with 223 additions and 43 deletions

View File

@@ -1321,6 +1321,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
updataCleanMic();
// initStarChallengeStatus();
enterRoomLeave.setVisibility(View.GONE);
topBanner1.setVisibility(View.GONE);
}
public void clearChat() {
@@ -4046,6 +4047,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank, 300);
break;
case PK_TWO_END:
EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", ""));
closePkTwo();
showAnchorSayAndCallAnchor();
@@ -4493,23 +4495,33 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
}
public void updateTopBanner(WishModel wishListProgress) {
if (mTopBannerList == null) {
mTopBannerList = new ArrayList<>();
}
topBanner1.setVisibility(View.VISIBLE);
BannerBean bannerBean = new BannerBean();
bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon())
.setWishlistName(wishListProgress.getWishlistName())
.setWishlistNum(wishListProgress.getWishlistNum())
.setWishlistProgress(wishListProgress.getWishlistProgress())
.setmLink(CommonAppConfig.HOST + "/index.php")
.setType(1)
private WishModel wishListProgress;
public LiveRoomViewHolder setWishListProgress(WishModel wishListProgress) {
this.wishListProgress = wishListProgress;
return this;
}
public void updateTopBanner() {
if (!TextUtils.isEmpty(wishListProgress.getWishlistName())||!TextUtils.isEmpty(wishListProgress.getWishlistProgress())) {
if (mTopBannerList == null) {
mTopBannerList = new ArrayList<>();
}
topBanner1.setVisibility(View.VISIBLE);
BannerBean bannerBean = new BannerBean();
bannerBean.setWishlistIcon(wishListProgress.getWishlistIcon())
.setWishlistName(wishListProgress.getWishlistName())
.setWishlistNum(wishListProgress.getWishlistNum())
.setWishlistProgress(wishListProgress.getWishlistProgress())
.setmLink(CommonAppConfig.HOST + "/index.php")
.setType(1)
;
bannerBean.setShow_type("2");
mTopBannerList.add(bannerBean);
topBanner1.update(mTopBannerList);
}
;
bannerBean.setShow_type("2");
mTopBannerList.add(bannerBean);
topBanner1.update(mTopBannerList);
}
public void initTopBanner() {
@@ -4590,6 +4602,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
System.out.println("!>>>>> 获取联系方式:" + error);
}
});
updateTopBanner();
}
private void checkNewLetter() {

View File

@@ -40,6 +40,7 @@ import com.yunbao.common.bean.LiveUserGiftBean;
import com.yunbao.common.bean.MsgModel;
import com.yunbao.common.bean.StarChallengeStatusModel;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.WishModel;
import com.yunbao.common.custom.MyViewPager;
import com.yunbao.common.event.FollowEvent;
import com.yunbao.common.event.LiveFloatEvent;
@@ -188,7 +189,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private int landscape;
private String leaveStream = "", leaveGroupId = "";
public static PortraitLiveManager portraitLiveManager;
private WishModel wishListProgress;
public PortraitLiveManager setQuitF(boolean quitF) {
isQuitF = quitF;
@@ -251,8 +252,21 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
public void run() {
loading.setVisibility(View.GONE);
enterRoomLeaveHandler.post(enterRoomLeaveRunnable);
topBannerHandler.postDelayed(topBannerRunnable, 6000);
}
};
private Runnable topBannerRunnable = new Runnable() {
@Override
public void run() {
if (mLiveRoomViewHolder != null) {
//初始化顶部banner
mLiveRoomViewHolder.initTopBanner();
}
}
};
private Handler topBannerHandler = new Handler();
@Override
public synchronized void onAdd(LiveBean data, int liveType, int liveTypeVal, int liveSdk) {
@@ -339,6 +353,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.resetView();
enterRoomModel.clear();
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
topBannerHandler.removeCallbacks(topBannerRunnable);
mLiveRoomViewHolder.setAvatar(data.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
mLiveRoomViewHolder.setName(data.getUserNiceName());
@@ -477,12 +492,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setMedaRankNum(data.getEnterRoomInfo().getMedalRankNum());
//初始化女神说
mLiveRoomViewHolder.initAnchorSay();
//初始化顶部banner
mLiveRoomViewHolder.initTopBanner();
wishListProgress = data.getWishListProgress();
//心愿单顶部bannner
if (data.getWishListProgress().getIsShow()!=0){
mLiveRoomViewHolder.updateTopBanner(data.getWishListProgress());
}
mLiveRoomViewHolder.setWishListProgress(wishListProgress);
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
if (isattention == 0) {