From 81e08d41af878bfbc54afb61c84b86904f92d912 Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Tue, 18 Jun 2024 18:42:26 +0800 Subject: [PATCH] =?UTF-8?q?FIX[=E4=BF=AE=E5=A4=8DBUG]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/activity/LiveRyAnchorActivity.java | 4 ++-- .../live/activity/LiveSwAnchorActivity.java | 5 ++--- .../live/dialog/LivePrankAddGiftDialog.java | 2 +- .../presenter/LiveSwLinkMicPkPresenter.java | 10 +++++++-- .../yunbao/live/views/LiveRoomViewHolder.java | 17 ++++++++------- .../live/views/PortraitLiveManager.java | 21 ++++++++++--------- live/src/main/res/layout/view_live_room.xml | 5 ++--- 7 files changed, 36 insertions(+), 28 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index ab2800dc6..ee9bcad2a 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -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(); } } diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index ac6adf962..e676ccb52 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -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); diff --git a/live/src/main/java/com/yunbao/live/dialog/LivePrankAddGiftDialog.java b/live/src/main/java/com/yunbao/live/dialog/LivePrankAddGiftDialog.java index 547c1b0fc..89d2c82b9 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LivePrankAddGiftDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/LivePrankAddGiftDialog.java @@ -42,7 +42,7 @@ public class LivePrankAddGiftDialog extends AbsDialogPopupWindow { @Override public void buildDialog(XPopup.Builder builder) { - + builder.autoFocusEditText(false); } public LivePrankAddGiftDialog setGiftBeans(List giftBeans,boolean isShow) { diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java index 00b05d47c..ee7cf0d6e 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java @@ -689,8 +689,10 @@ public class LiveSwLinkMicPkPresenter extends AbsLinkMicPkPresenter implements V onLinkMicPkStart(mApplyUid, 2); } }); - //收起整蠱列表 - mLiveRoomViewHolder.closePrankView(); + //收起整蛊列表 + if(mLiveRoomViewHolder!=null){ + mLiveRoomViewHolder.closePrankView(); + } } @Override @@ -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(); + } } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 7f2a4d58f..72dfc078f 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -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() { @@ -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()){ diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index c7ba39f48..8418373ec 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -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 diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index 358f5a08c..63412cec3 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -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" />