From 65b045ca610a35f53eb61b3e3eb862423f928572 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 18 Jun 2024 19:24:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5PD=E4=BF=AE=E5=A4=8D=E5=86=85?= =?UTF-8?q?=E5=AE=B9:=20FIX[=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 | 19 ++++++++++------- .../live/views/PortraitLiveManager.java | 21 ++++++++++--------- live/src/main/res/layout/view_live_room.xml | 5 ++--- 7 files changed, 37 insertions(+), 29 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 f99b445e0..f7ed22632 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 ffe014b60..3093164e7 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 e12052bb5..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); @@ -1644,7 +1644,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis reloadIM(); // initStarChallengeStatus(); - new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1); pa_pao_layout = (FrameLayout) findViewById(R.id.pa_pao_layout); combo_layout = (LinearLayout) findViewById(R.id.combo_layout); @@ -1789,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() { @@ -1802,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 @@ -1824,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); @@ -1852,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()); @@ -1890,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){ @@ -1902,8 +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 610a94513..7fd444ca1 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -230,6 +230,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; @@ -405,8 +406,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(); @@ -431,10 +434,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); } } @@ -637,9 +642,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) { @@ -726,8 +728,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLivePlayViewHolder.setPkView(connection_info.getPkuid()); } } - //收起整蠱列表 - mLiveRoomViewHolder.closePrankView(); + isShowPrank = false; } if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.pkHandler = false; @@ -755,6 +756,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; @@ -773,13 +775,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) { @@ -812,8 +813,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) { @@ -899,7 +899,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 96261cf97..128175b00 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -2417,13 +2417,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" />