FIX[修复BUG]

This commit is contained in:
Martin 2024-06-18 18:42:26 +08:00
parent d89b356395
commit 81e08d41af
7 changed files with 36 additions and 28 deletions

View File

@ -379,7 +379,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
@Override
public void OpenAndCloseListener() {
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress();
mLiveRoomViewHolder.initPrankProgress(1);
}
}
});
@ -881,7 +881,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
MicUserManager.get().removeAllMicUserList();
//加载整蛊
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress();
mLiveRoomViewHolder.initPrankProgress(2);
mLiveRoomViewHolder.sendMsgPrank();
}
}

View File

@ -245,7 +245,6 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
mContainerWrap = (ViewGroup) findViewById(R.id.container_wrap);
mContainer = (ViewGroup) findViewById(R.id.container);
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePushViewHolder, true, mContainer);
RandomPkManager.getInstance().addOnRandomPkTimer(onRandomPkTimer);
manager.setOnMirrorChanged(new FaceManager.OnMirrorChanged() {
@ -369,7 +368,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
@Override
public void OpenAndCloseListener() {
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress();
mLiveRoomViewHolder.initPrankProgress(1);
}
}
});
@ -876,7 +875,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
MicUserManager.get().removeAllMicUserList();
//加载整蛊
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.initPrankProgress();
mLiveRoomViewHolder.initPrankProgress(2);
mLiveRoomViewHolder.sendMsgPrank();
}
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);

View File

@ -42,7 +42,7 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow {
@Override
public void buildDialog(XPopup.Builder builder) {
builder.autoFocusEditText(false);
}
public LivePrankAddGiftDialog setGiftBeans(List<PrankGiftBean> giftBeans,boolean isShow) {

View File

@ -689,9 +689,11 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
onLinkMicPkStart(mApplyUid, 2);
}
});
//收起整蠱列表
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
}
@Override
protected void onDRPkApply(UserBean u) {
@ -1523,6 +1525,10 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V
mPkTimeCount = PK_TIME_MAX;
}
Log.d("mPkTimeCount2", "" + mPkTimeCount + ";mPkTimeFromServer=" + mPkTimeFromServer);
//收起整蛊列表
if(mLiveRoomViewHolder!=null){
mLiveRoomViewHolder.closePrankView();
}
}

View File

@ -1397,7 +1397,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
fragment.setOnPrankResultListener(new LivePrankDialogFragment.onPrankResultListener() {
@Override
public void OpenAndCloseListener() {
initPrankProgress();
initPrankProgress(1);
}
});
fragment.setmLiveUid(mLiveUid);
@ -1788,7 +1788,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//初始化整蛊列表进度
public void initPrankProgress(){
public void initPrankProgress(int isShow){
// LogUtils.e("yqw=====>主播id:"+mLiveUid);
//获取整蛊列表
LiveNetManager.get(mContext).getPrankProgressList(mLiveUid, new com.yunbao.common.http.base.HttpCallback<PrankProgressBean>() {
@ -1801,7 +1801,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
prankAndComboList.addAll(data.getPrank_list());
completedList.clear();
completedList.addAll(data.getCompleted_list());
setPrankList(true,data.getStatus(),data.getPrank_type(),data.getPrank_turntable_status());
setPrankList(isShow,data.getStatus(),data.getPrank_type(),data.getPrank_turntable_status());
}
@Override
@ -1823,7 +1823,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//列表全部更新
if (ctString.getInt("status")==1){
//编辑添加整蛊
initPrankProgress();
initPrankProgress(1);
}else {
//编辑取消整蛊
prank_group.setVisibility(View.GONE);
@ -1851,7 +1851,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
completedList.clear();
completedList.addAll(completeds);
setPrankList(false,Integer.parseInt(ctString.getString("status")), Integer.parseInt(ctString.getString("prank_type")), Integer.parseInt(ctString.getString("prank_turntable_status")));
setPrankList(0,Integer.parseInt(ctString.getString("status")), Integer.parseInt(ctString.getString("prank_type")), Integer.parseInt(ctString.getString("prank_turntable_status")));
}
}catch (Exception e){
LogUtils.e("yqw=====>转换错误:"+e.getMessage());
@ -1889,7 +1889,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
//设置整蛊礼物数据
private void setPrankList(boolean isShow,int status,int mPrankType,int prankTurntableStatus){
private void setPrankList(int isShow,int status,int mPrankType,int prankTurntableStatus){
this.mPrankType =mPrankType;
// LogUtils.e("yqw=====>显示转盘icon:是否显示:"+(prankTurntableStatus == 1)+",是否在倒计时"+(lt_trickery.getVisibility() == View.VISIBLE));
if (prankTurntableStatus == 1 && lt_trickery.getVisibility() == View.GONE){
@ -1901,9 +1901,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
// LogUtils.e("yqw=====>显示整蛊列表或者投票列表:"+status);
if (status == 1){
if(isShow){
if(isShow==1){
prank_group.setVisibility(View.VISIBLE);
prank_small_icon.setVisibility(View.GONE);
}else if(isShow==2){
prank_group.setVisibility(View.GONE);
prank_small_icon.setVisibility(View.VISIBLE);
}
//主播可能打开整蛊功能但是不设置整蛊礼物这里会是空列表
if (!prankAndComboList.isEmpty()){

View File

@ -231,6 +231,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private static int waitShowTopBannerTime = 6000;
private boolean isSw;
private boolean isShowPrank = true;
public PortraitLiveManager setQuitF(boolean quitF) {
isQuitF = quitF;
@ -407,8 +408,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
if (isSw) {
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
} else {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveRyLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
}
mLivePlayViewHolder.initSwEngine(mLiveBean.getUid());
mLivePlayViewHolder.addToParent();
@ -433,10 +436,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (isSw) {
if (mLiveSwLinkMicPkPresenter == null) {
mLiveSwLinkMicPkPresenter = new LiveSwLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveSwLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
}
} else {
if (mLiveRyLinkMicPkPresenter == null) {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLiveRyLinkMicPkPresenter.setmLiveRoomViewHolder(mLiveRoomViewHolder);
}
}
@ -639,9 +644,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLiveRoomViewHolder.setVoteData(data.getEnterRoomInfo().getVoteModel());
mLiveRoomViewHolder.updateFansMessageRed();
mLiveRoomViewHolder.setFansGroup(data.getEnterRoomInfo().getIsFans());
//初始化整蛊进度列表
mLiveRoomViewHolder.initPrankProgress();
isattention = Integer.parseInt(data.getEnterRoomInfo().getIsattention());
if (isattention == 0) {
@ -728,8 +730,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.setPkView(connection_info.getPkuid());
}
}
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
isShowPrank = false;
}
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = false;
@ -757,6 +758,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} else {
mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean);
}
isShowPrank = false;
} else if (!pkInfo.getString("end_pk_time").equals("0")) {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.pkHandler = true;
@ -775,13 +777,12 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} else {
mLiveRyLinkMicPkPresenter.onEnterRoomCFStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("end_pk_time"), livePKUserListBean);
}
isShowPrank = false;
} else {
if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.initPkRank(null);
}
}
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
//多人PK
} else if (pkInfo != null && pkInfo.getIntValue("drpk_status") == 1) {
if (mLiveRoomViewHolder != null) {
@ -814,8 +815,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
}
upDataPkScore(pkInfo.getJSONArray("userlist"), pkInfo.getIntValue("drpk_time"));
//收起整蠱列表
mLiveRoomViewHolder.closePrankView();
isShowPrank = false;
}
if (data.getEnterRoomInfo().getGuard() != null) {
if (mLiveRoomViewHolder != null) {
@ -900,7 +900,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (!TextUtils.isEmpty(data.getModel().getSendMoneyLongKey())) {
mLiveRoomViewHolder.onSendMoneyLong();
}
//初始化整蠱列表
mLiveRoomViewHolder.initPrankProgress(isShowPrank?1:2);
}
@Override

View File

@ -2447,13 +2447,12 @@
android:layout_width="52dp"
android:layout_height="76dp"
android:layout_marginTop="20dp"
tools:visibility="visible"
android:layout_gravity="end"
android:layout_marginEnd="16dp"
android:visibility="gone"
app:delay_time="5000"
app:indicator_height="8dp"
app:indicator_width="8dp" />
tools:visibility="visible"
app:indicator_height="8dp" />
<LinearLayout
android:id="@+id/lt_trickery"