From 503fb0d7f161524b7125c1780b3cd57775319f68 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 10 Dec 2022 14:47:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=BA=BAPk=E9=97=AE=E9=A2=98=E4=B8=BB?= =?UTF-8?q?=E6=92=AD=E7=AB=AF=E4=BF=AE=E5=A4=8D=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 2 +- .../live/activity/LiveRyAnchorActivity.java | 13 +++++++------ .../yunbao/live/event/LiveAudienceEvent.java | 3 ++- .../presenter/LiveRyLinkMicPkPresenter.java | 6 +++--- .../com/yunbao/live/socket/SocketRyClient.java | 13 ++----------- .../live/views/LivePushRyViewHolder.java | 18 ++++++++++++++---- 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/config.gradle b/config.gradle index d9d2c3a12..b1defc16c 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { minSdkVersion : 21, targetSdkVersion : 31, versionCode : 310, - versionName : "6.4.7" + versionName : "6.4.5" ] manifestPlaceholders = [ //正式 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 4b87c2a7a..0a61d28f8 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -49,6 +49,7 @@ import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMRTCManager; +import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.utils.BitmapUtil; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DateFormatUtil; @@ -64,8 +65,6 @@ import com.yunbao.live.R; import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveReceiveGiftBean; -import com.yunbao.common.bean.LiveUserGiftBean; -import com.yunbao.common.bean.MicUserBean; import com.yunbao.live.dialog.FreePkDialogFragment; import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; @@ -85,8 +84,6 @@ import com.yunbao.live.presenter.LiveRyLinkMicPkPresenter; import com.yunbao.live.socket.SocketRyChatUtil; import com.yunbao.live.socket.SocketRyClient; import com.yunbao.live.socket.SocketSendBean; -import com.yunbao.common.utils.MicStatusManager; -import com.yunbao.common.manager.RandomPkManager; import com.yunbao.live.views.LiveEndViewHolder; import com.yunbao.live.views.LiveMusicViewHolder; import com.yunbao.live.views.LiveNewReadyRyViewHolder; @@ -98,9 +95,7 @@ import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.ThreadMode; import java.io.File; -import java.util.ArrayList; import java.util.List; -import java.util.TreeMap; import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; @@ -1453,6 +1448,12 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl mLiveRoomViewHolder.endDRGif(); } break; + case DISCONNEXT_PK_TIME: + if (mLivePushViewHolder != null) { + mLivePushViewHolder.changeToBig(); + mLivePushViewHolder.closeButtonGone(); + } + break; } } diff --git a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java index 3b37cdf07..534886686 100644 --- a/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java +++ b/live/src/main/java/com/yunbao/live/event/LiveAudienceEvent.java @@ -229,7 +229,8 @@ public class LiveAudienceEvent extends BaseModel { SOCKET_LIVE_DRPK_SET_PK_END_VIEW(45, "setPkEndview"), LEAVE_DR_ROOM(46, "结束多人PK"), LEAVE_PK_SCORE(47, "PK排名"), - PK_TIME_COUNT(48, "多人PK结束"); + PK_TIME_COUNT(48, "多人PK结束"), + DISCONNEXT_PK_TIME(50, "单人Pk结束"); private int type; private String name; diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java index b42df7468..dff040b5d 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -376,7 +376,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960); params.weight = 1; params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); - livePushRyViewHolder.mPreView.setLayoutParams(params); + livePushRyViewHolder.camera.setLayoutParams(params); livePushRyViewHolder.mPreView1.setLayoutParams(params); } @@ -766,7 +766,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960); params.weight = 1; params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); - livePushRyViewHolder.mPreView.setLayoutParams(params); + livePushRyViewHolder.camera.setLayoutParams(params); livePushRyViewHolder.mPreView1.setLayoutParams(params); livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE); @@ -810,7 +810,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960); params.weight = 1; params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); - livePushRyViewHolder.mPreView.setLayoutParams(params); + livePushRyViewHolder.camera.setLayoutParams(params); livePushRyViewHolder.mPreView1.setLayoutParams(params); livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE); LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java index d7b7ac978..4c301fa2d 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketRyClient.java @@ -1070,17 +1070,8 @@ public class SocketRyClient { break; case 5://PK时候断开连麦的回调 if (rtcRoom != null) { - RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_CLOSE); - /* if (LivePushRyViewHolder.mPreView1 != null) { - LivePushRyViewHolder.mPreView1.removeAllViews(); - LivePushRyViewHolder.mPreView1.setVisibility(View.GONE); - isDRPK = 0; - leaveDRRoom(); - }*/ - LivePushRyViewHolder.btn_close.setVisibility(View.GONE); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); - params.topMargin = 0; -// LivePushRyViewHolder.mPreView.setLayoutParams(params); + Bus.get().post(new LiveAudienceEvent() + .setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME)); //断开连麦 HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") .execute(new HttpCallback() { diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index 5bc8c6642..2dc0ba934 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -416,6 +416,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX mPreView1.setVisibility(View.GONE); inputStreamList.clear(); inputStreamList1.clear(); + changeToBig(); } }); } @@ -621,19 +622,28 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX params.width = mPreView.getWidth() / 2; params.height = DpUtil.dp2px(250); params.topMargin = DpUtil.dp2px(130); - mPreView.setLayoutParams(params); + camera.setLayoutParams(params); } } @Override public void changeToBig() { - if (mPreView != null) { - FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mPreView.getLayoutParams(); + if (camera != null) { + LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) camera.getLayoutParams(); params.width = ViewGroup.LayoutParams.MATCH_PARENT; params.height = ViewGroup.LayoutParams.MATCH_PARENT; params.topMargin = 0; - mPreView.setLayoutParams(params); + camera.setLayoutParams(params); } + if (mPreView1.getVisibility()==View.VISIBLE){ + mPreView1.removeAllViews(); + mPreView1.setVisibility(View.GONE); + inputStreamList.clear(); + inputStreamList1.clear(); + } + } + public void closeButtonGone(){ + btn_close.setVisibility(View.GONE); } @Override