单人Pk问题主播端修复修复

This commit is contained in:
18401019693 2022-12-10 14:47:29 +08:00
parent 6b0500b5ff
commit 503fb0d7f1
6 changed files with 29 additions and 26 deletions

View File

@ -5,7 +5,7 @@ ext {
minSdkVersion : 21, minSdkVersion : 21,
targetSdkVersion : 31, targetSdkVersion : 31,
versionCode : 310, versionCode : 310,
versionName : "6.4.7" versionName : "6.4.5"
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //

View File

@ -49,6 +49,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.http.HttpClient; import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.manager.IMRTCManager; import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.utils.BitmapUtil; import com.yunbao.common.utils.BitmapUtil;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DateFormatUtil; 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.LiveGuardInfo;
import com.yunbao.live.bean.LiveKsyConfigBean; import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.bean.LiveReceiveGiftBean; 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.FreePkDialogFragment;
import com.yunbao.live.dialog.LiveLinkMicListDialogFragment; import com.yunbao.live.dialog.LiveLinkMicListDialogFragment;
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment; 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.SocketRyChatUtil;
import com.yunbao.live.socket.SocketRyClient; import com.yunbao.live.socket.SocketRyClient;
import com.yunbao.live.socket.SocketSendBean; 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.LiveEndViewHolder;
import com.yunbao.live.views.LiveMusicViewHolder; import com.yunbao.live.views.LiveMusicViewHolder;
import com.yunbao.live.views.LiveNewReadyRyViewHolder; import com.yunbao.live.views.LiveNewReadyRyViewHolder;
@ -98,9 +95,7 @@ import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode; import org.greenrobot.eventbus.ThreadMode;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.TreeMap;
import cn.rongcloud.rtc.api.RCRTCEngine; import cn.rongcloud.rtc.api.RCRTCEngine;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
@ -1453,6 +1448,12 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
mLiveRoomViewHolder.endDRGif(); mLiveRoomViewHolder.endDRGif();
} }
break; break;
case DISCONNEXT_PK_TIME:
if (mLivePushViewHolder != null) {
mLivePushViewHolder.changeToBig();
mLivePushViewHolder.closeButtonGone();
}
break;
} }
} }

View File

@ -229,7 +229,8 @@ public class LiveAudienceEvent extends BaseModel {
SOCKET_LIVE_DRPK_SET_PK_END_VIEW(45, "setPkEndview"), SOCKET_LIVE_DRPK_SET_PK_END_VIEW(45, "setPkEndview"),
LEAVE_DR_ROOM(46, "结束多人PK"), LEAVE_DR_ROOM(46, "结束多人PK"),
LEAVE_PK_SCORE(47, "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 int type;
private String name; private String name;

View File

@ -376,7 +376,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
params.weight = 1; params.weight = 1;
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
livePushRyViewHolder.mPreView.setLayoutParams(params); livePushRyViewHolder.camera.setLayoutParams(params);
livePushRyViewHolder.mPreView1.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); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
params.weight = 1; params.weight = 1;
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
livePushRyViewHolder.mPreView.setLayoutParams(params); livePushRyViewHolder.camera.setLayoutParams(params);
livePushRyViewHolder.mPreView1.setLayoutParams(params); livePushRyViewHolder.mPreView1.setLayoutParams(params);
livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE); 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); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
params.weight = 1; params.weight = 1;
params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top); params.topMargin = mContext.getResources().getDimensionPixelOffset(R.dimen.live_top);
livePushRyViewHolder.mPreView.setLayoutParams(params); livePushRyViewHolder.camera.setLayoutParams(params);
livePushRyViewHolder.mPreView1.setLayoutParams(params); livePushRyViewHolder.mPreView1.setLayoutParams(params);
livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE); livePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE);
LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE); LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE);

View File

@ -1070,17 +1070,8 @@ public class SocketRyClient {
break; break;
case 5://PK时候断开连麦的回调 case 5://PK时候断开连麦的回调
if (rtcRoom != null) { if (rtcRoom != null) {
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_CLOSE); Bus.get().post(new LiveAudienceEvent()
/* if (LivePushRyViewHolder.mPreView1 != null) { .setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
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);
//断开连麦 //断开连麦
HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout")
.execute(new HttpCallback() { .execute(new HttpCallback() {

View File

@ -416,6 +416,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
mPreView1.setVisibility(View.GONE); mPreView1.setVisibility(View.GONE);
inputStreamList.clear(); inputStreamList.clear();
inputStreamList1.clear(); inputStreamList1.clear();
changeToBig();
} }
}); });
} }
@ -621,19 +622,28 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
params.width = mPreView.getWidth() / 2; params.width = mPreView.getWidth() / 2;
params.height = DpUtil.dp2px(250); params.height = DpUtil.dp2px(250);
params.topMargin = DpUtil.dp2px(130); params.topMargin = DpUtil.dp2px(130);
mPreView.setLayoutParams(params); camera.setLayoutParams(params);
} }
} }
@Override @Override
public void changeToBig() { public void changeToBig() {
if (mPreView != null) { if (camera != null) {
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mPreView.getLayoutParams(); LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) camera.getLayoutParams();
params.width = ViewGroup.LayoutParams.MATCH_PARENT; params.width = ViewGroup.LayoutParams.MATCH_PARENT;
params.height = ViewGroup.LayoutParams.MATCH_PARENT; params.height = ViewGroup.LayoutParams.MATCH_PARENT;
params.topMargin = 0; 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 @Override