主播端多人PK
This commit is contained in:
parent
1e595ec526
commit
3de7160538
@ -5,8 +5,6 @@ import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_DISABLE;
|
|||||||
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
|
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_MIRROR_TYPE_ENABLE;
|
||||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK;
|
||||||
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK_RANDOM;
|
import static com.yunbao.common.Constants.SOCKET_LIVE_DRPK_RANDOM;
|
||||||
import static com.yunbao.live.views.AbsRyLivePushViewHolder.mPreView;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
|
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_dr_pk_nub;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_dr_pk_nub;
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk;
|
||||||
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
|
import static com.yunbao.live.views.LiveRyAnchorViewHolder.btn_start_dr_pk_view;
|
||||||
@ -24,7 +22,6 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@ -66,11 +63,9 @@ 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;
|
||||||
import com.yunbao.common.utils.DialogUitl;
|
import com.yunbao.common.utils.DialogUitl;
|
||||||
import com.yunbao.common.utils.DpUtil;
|
|
||||||
import com.yunbao.common.utils.L;
|
import com.yunbao.common.utils.L;
|
||||||
import com.yunbao.common.utils.LogUtil;
|
import com.yunbao.common.utils.LogUtil;
|
||||||
import com.yunbao.common.utils.MicStatusManager;
|
import com.yunbao.common.utils.MicStatusManager;
|
||||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.common.utils.WordUtil;
|
import com.yunbao.common.utils.WordUtil;
|
||||||
@ -406,7 +401,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
|
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
btn_start_dr_pk.setVisibility(View.VISIBLE);
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
// dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
final SocketSendBean msg1 = new SocketSendBean()
|
final SocketSendBean msg1 = new SocketSendBean()
|
||||||
.param("_method_", SOCKET_LIVE_DRPK)
|
.param("_method_", SOCKET_LIVE_DRPK)
|
||||||
.param("action", 9)
|
.param("action", 9)
|
||||||
@ -426,18 +421,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess(Message message) {
|
public void onSuccess(Message message) {
|
||||||
isDRPK = 1;
|
isDRPK = 1;
|
||||||
|
|
||||||
btn_start_dr_pk_view.setVisibility(View.VISIBLE);
|
btn_start_dr_pk_view.setVisibility(View.VISIBLE);
|
||||||
dr_pk_view.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
ScreenDimenUtil util = ScreenDimenUtil.getInstance();
|
|
||||||
int mScreenWdith = util.getScreenWdith();
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960);
|
|
||||||
params.weight = 1;
|
|
||||||
params.topMargin = DpUtil.dp2px(123);
|
|
||||||
dr_pk_view.setLayoutParams(params);
|
|
||||||
mPreView.setLayoutParams(params);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1577,7 +1561,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
mLiveRyLinkMicPkPresenter.leaveDRRoom();
|
mLiveRyLinkMicPkPresenter.leaveDRRoom();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case LEAVE_PK_SCORE:
|
||||||
|
if (mLiveRyLinkMicPkPresenter != null) {
|
||||||
|
mLiveRyLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime());
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PK_TIME_COUNT:
|
case PK_TIME_COUNT:
|
||||||
if (mLiveRoomViewHolder != null) {
|
if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.endDRGif();
|
mLiveRoomViewHolder.endDRGif();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3,8 +3,6 @@ package com.yunbao.live.socket;
|
|||||||
import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
|
import static com.blankj.utilcode.util.SnackbarUtils.dismiss;
|
||||||
import static com.blankj.utilcode.util.ViewUtils.runOnUiThread;
|
import static com.blankj.utilcode.util.ViewUtils.runOnUiThread;
|
||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.isDRPK;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.dr_pk_view;
|
|
||||||
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
|
||||||
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
|
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
|
||||||
|
|
||||||
@ -154,7 +152,6 @@ public class SocketRyClient {
|
|||||||
public void processBroadcast(String socketMsg) {
|
public void processBroadcast(String socketMsg) {
|
||||||
L.e("收到socket--->" + socketMsg);
|
L.e("收到socket--->" + socketMsg);
|
||||||
|
|
||||||
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
|
||||||
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
Log.i("SocketRyClient", "socketMsg" + socketMsg);
|
||||||
|
|
||||||
if (Constants.SOCKET_STOP_PLAY.equals(socketMsg)) {
|
if (Constants.SOCKET_STOP_PLAY.equals(socketMsg)) {
|
||||||
@ -282,42 +279,58 @@ public class SocketRyClient {
|
|||||||
}
|
}
|
||||||
//收到对方同意多人PK邀请
|
//收到对方同意多人PK邀请
|
||||||
else if (action3 == 2) {
|
else if (action3 == 2) {
|
||||||
UserBean u = new UserBean();
|
// UserBean u = new UserBean();
|
||||||
// u.setUserNiceName(map.getString("uname"));
|
//// u.setUserNiceName(map.getString("uname"));
|
||||||
u.setId(map.getString("uid"));
|
// u.setId(map.getString("uid"));
|
||||||
mListener.onLinkDRMicPkApplyOk(u);
|
// mListener.onLinkDRMicPkApplyOk(u);
|
||||||
} else if (action3 == 6) {
|
} else if (action3 == 6) {//开始Pk
|
||||||
if (LiveRoomViewHolder.mHandler != null) {
|
if (LiveRoomViewHolder.mHandler != null) {
|
||||||
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
LiveRoomViewHolder.mHandler.removeCallbacksAndMessages(null);
|
||||||
}
|
}
|
||||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, map.getIntValue("drpk_time"));
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||||
|
.setPkScores(map.getJSONArray("userlist"))
|
||||||
|
.setUid(mLiveUid)
|
||||||
|
.setTime(map.getIntValue("drpk_time")));
|
||||||
if (livePushRyViewHolder == null) {
|
if (livePushRyViewHolder == null) {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (action3 == 5) {
|
} else if (action3 == 5) {
|
||||||
// EventBus.getDefault().post(new LiveAudienceEvent()
|
// endDRGif();
|
||||||
// .setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
|
||||||
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
|
LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE);
|
||||||
if (LiveRyAnchorActivity.mLiveAnchorViewHolder != null) {
|
if (LiveRyAnchorActivity.mLiveAnchorViewHolder != null) {
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
params.topMargin = 0;
|
params.topMargin = 0;
|
||||||
LivePushRyViewHolder.mPreView.setLayoutParams(params);
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
leaveDRRoom();
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||||
isDRPK = 0;
|
isDRPK = 0;
|
||||||
} else {
|
} else {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
// LiveAudienceActivity.getmLivePlayViewHolder().setPkEndview();
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_END_VIEW)
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
//創建了多人房間
|
//創建了多人房間
|
||||||
} else if (action3 == 3) {
|
} else if (action3 == 3) {
|
||||||
if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
/* if (LiveAudienceActivity.getmLivePlayViewHolder() != null) {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||||
}
|
}*/
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||||
|
);
|
||||||
isDRPK = 1;
|
isDRPK = 1;
|
||||||
} else if (action3 == 10) {
|
} else if (action3 == 10) {
|
||||||
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
|
if (!map.getString("uid").equals(CommonAppConfig.getInstance().getUid())) {
|
||||||
LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
// LiveAudienceActivity.getmLivePlayViewHolder().setPkview();
|
||||||
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.SOCKET_LIVE_DRPK_SET_PK_VIEW)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -925,7 +938,12 @@ public class SocketRyClient {
|
|||||||
mListener.onSendGift(receiveGiftBean);
|
mListener.onSendGift(receiveGiftBean);
|
||||||
}
|
}
|
||||||
if (map.getIntValue("drpk_status") == 1) {
|
if (map.getIntValue("drpk_status") == 1) {
|
||||||
LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_PK_SCORE)
|
||||||
|
.setPkScores(map.getJSONArray("userlist"))
|
||||||
|
.setUid(mLiveUid)
|
||||||
|
.setTime(0));
|
||||||
|
// LiveRoomViewHolder.UpPkBar(map.getJSONArray("userlist"), mLiveUid, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1075,16 +1093,8 @@ public class SocketRyClient {
|
|||||||
break;
|
break;
|
||||||
case 5://PK时候断开连麦的回调
|
case 5://PK时候断开连麦的回调
|
||||||
if (rtcRoom != null) {
|
if (rtcRoom != null) {
|
||||||
if (LivePushRyViewHolder.mPreView1 != null) {
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
LivePushRyViewHolder.mPreView1.removeAllViews();
|
.setType(LiveAudienceEvent.LiveAudienceType.DISCONNEXT_PK_TIME));
|
||||||
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() {
|
||||||
|
@ -32,9 +32,10 @@ public class AbsRyLivePushViewHolder extends AbsViewHolder implements ILivePushV
|
|||||||
protected ViewGroup mLeftContainer;
|
protected ViewGroup mLeftContainer;
|
||||||
protected ViewGroup mRightContainer;
|
protected ViewGroup mRightContainer;
|
||||||
protected ViewGroup mPkContainer;
|
protected ViewGroup mPkContainer;
|
||||||
public static FrameLayout mPreView,mPreView1,dr1_preview,dr2_preview,dr3_preview,dr4_preview;
|
public FrameLayout mPreView, mPreView1, cameraPreview3, dr1_preview, dr2_preview, dr3_preview, dr4_preview;
|
||||||
public static ImageView leave;
|
public ImageView leave;
|
||||||
protected boolean mOpenCamera;//是否选择了相机
|
protected boolean mOpenCamera;//是否选择了相机
|
||||||
|
public LinearLayout camera;
|
||||||
|
|
||||||
//倒计时
|
//倒计时
|
||||||
protected TextView mCountDownText;
|
protected TextView mCountDownText;
|
||||||
|
@ -102,11 +102,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
public TencentTRTCBeautyManager tencentTRTCBeautyManager;
|
public TencentTRTCBeautyManager tencentTRTCBeautyManager;
|
||||||
public static Context contexts;
|
public static Context contexts;
|
||||||
public static TextView btn_close;
|
public static TextView btn_close;
|
||||||
public static LinearLayout dr_pk_view;
|
public LinearLayout dr_pk_view;
|
||||||
public static RCRTCRoom rtcRoom;
|
public static RCRTCRoom rtcRoom;
|
||||||
public static RCRTCLiveInfo rcrtcLiveInfo;
|
public static RCRTCLiveInfo rcrtcLiveInfo;
|
||||||
|
|
||||||
private ViewGroup liveActivityContainer;
|
private ViewGroup liveActivityContainer;
|
||||||
|
public FrameLayout timeTitle;
|
||||||
|
public TextView textTime;
|
||||||
private TextView tv_avatarOther_name;
|
private TextView tv_avatarOther_name;
|
||||||
private ImageView avatarOther;
|
private ImageView avatarOther;
|
||||||
private LinearLayout goto_room_view;
|
private LinearLayout goto_room_view;
|
||||||
@ -341,6 +343,8 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
userBean1.setUserNiceName("null");
|
userBean1.setUserNiceName("null");
|
||||||
userBean1.setAvatar("null");
|
userBean1.setAvatar("null");
|
||||||
}
|
}
|
||||||
|
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
||||||
|
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3);
|
||||||
//单人PK,减掉次数
|
//单人PK,减掉次数
|
||||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||||
@ -398,14 +402,19 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
super.init();
|
super.init();
|
||||||
Bus.getOn(this);
|
Bus.getOn(this);
|
||||||
mPreView = (FrameLayout) findViewById(R.id.camera_preview);
|
mPreView = (FrameLayout) findViewById(R.id.camera_preview);
|
||||||
|
camera = (LinearLayout) findViewById(R.id.camera);
|
||||||
mPreView1 = (FrameLayout) findViewById(R.id.camera_preview1);
|
mPreView1 = (FrameLayout) findViewById(R.id.camera_preview1);
|
||||||
|
cameraPreview3 = (FrameLayout) findViewById(R.id.camera_preview3);
|
||||||
dr1_preview = (FrameLayout) findViewById(R.id.dr1_preview);
|
dr1_preview = (FrameLayout) findViewById(R.id.dr1_preview);
|
||||||
dr2_preview = (FrameLayout) findViewById(R.id.dr2_preview);
|
dr2_preview = (FrameLayout) findViewById(R.id.dr2_preview);
|
||||||
dr3_preview = (FrameLayout) findViewById(R.id.dr3_preview);
|
dr3_preview = (FrameLayout) findViewById(R.id.dr3_preview);
|
||||||
dr4_preview = (FrameLayout) findViewById(R.id.dr4_preview);
|
dr4_preview = (FrameLayout) findViewById(R.id.dr4_preview);
|
||||||
leave = (ImageView) findViewById(R.id.leave);
|
leave = (ImageView) findViewById(R.id.leave);
|
||||||
dr_pk_view = (LinearLayout) findViewById(R.id.dr_pk_view);
|
dr_pk_view = (LinearLayout) findViewById(R.id.dr_pk_view);
|
||||||
|
timeTitle = (FrameLayout) findViewById(R.id.time_title);
|
||||||
|
textTime = (TextView) findViewById(R.id.text_time);
|
||||||
dr_pk_view.setVisibility(View.GONE);
|
dr_pk_view.setVisibility(View.GONE);
|
||||||
|
cameraPreview3.setVisibility(View.GONE);
|
||||||
btn_close = (TextView) findViewById(R.id.btn_close);
|
btn_close = (TextView) findViewById(R.id.btn_close);
|
||||||
tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name);
|
tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name);
|
||||||
avatarOther = (ImageView) findViewById(R.id.avatarOther);
|
avatarOther = (ImageView) findViewById(R.id.avatarOther);
|
||||||
@ -450,6 +459,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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -668,19 +678,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
|
||||||
|
@ -5,7 +5,6 @@ import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
|||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@ -149,7 +148,8 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
.execute(new HttpCallback() {
|
.execute(new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
leaveDRRoom();
|
Bus.get().post(new LiveAudienceEvent()
|
||||||
|
.setType(LiveAudienceEvent.LiveAudienceType.LEAVE_DR_ROOM));
|
||||||
PKing = false;
|
PKing = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,33 +1,49 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<FrameLayout
|
<LinearLayout
|
||||||
android:id="@+id/camera_preview"
|
android:id="@+id/camera"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/camera_preview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/camera_preview3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/camera_preview1"
|
android:id="@+id/camera_preview1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/dr_pk_view"
|
<LinearLayout
|
||||||
|
android:id="@+id/dr_pk_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toLeftOf="@+id/camera_preview"
|
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="130dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -37,17 +53,17 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr1_preview"
|
android:id="@+id/dr1_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr2_preview"
|
android:id="@+id/dr2_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:layout_weight="1"
|
||||||
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@ -59,24 +75,23 @@
|
|||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr3_preview"
|
android:id="@+id/dr3_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/dr4_preview"
|
android:id="@+id/dr4_preview"
|
||||||
android:layout_width="100dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@mipmap/live_icon_vacancy"/>
|
android:background="@mipmap/live_icon_vacancy" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
@ -85,24 +100,20 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:visibility="gone"
|
|
||||||
android:id="@+id/layout_surface"
|
android:id="@+id/layout_surface"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<SurfaceView
|
<SurfaceView
|
||||||
android:id="@+id/surface_view"
|
android:id="@+id/surface_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent" />
|
||||||
/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -112,9 +123,9 @@
|
|||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginTop="122dp"
|
android:layout_marginTop="122dp"
|
||||||
android:layout_marginRight="9dp"
|
android:layout_marginRight="9dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:background="@drawable/bg_live_other_ico"
|
android:background="@drawable/bg_live_other_ico"
|
||||||
android:gravity="center">
|
android:gravity="center"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="21dp"
|
android:layout_width="21dp"
|
||||||
@ -145,56 +156,54 @@
|
|||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/pk_container"
|
android:id="@+id/pk_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="270dp"
|
android:layout_height="270dp"
|
||||||
android:layout_marginTop="130dp"
|
android:layout_marginTop="130dp">
|
||||||
>
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout4
|
<com.yunbao.live.custom.MyFrameLayout4
|
||||||
android:id="@+id/left_container"
|
android:id="@+id/left_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout4
|
<com.yunbao.live.custom.MyFrameLayout4
|
||||||
android:id="@+id/right_container"
|
android:id="@+id/right_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="right"
|
android:layout_gravity="right"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginBottom="20dp" />
|
||||||
/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
<TextView android:id="@+id/btn_close"
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_close"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="5dp"
|
android:layout_alignParentRight="true"
|
||||||
android:paddingBottom="5dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:layout_marginTop="400dp"
|
android:layout_marginTop="400dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_alignParentRight="true"
|
android:background="@drawable/background_dedede"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
android:text="結束連麥"
|
android:text="結束連麥"
|
||||||
android:textSize="13sp"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@color/color_white"
|
android:textColor="@color/color_white"
|
||||||
android:background="@drawable/background_dedede"/>
|
android:textSize="13sp"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
<com.yunbao.live.custom.MyFrameLayout3
|
<com.yunbao.live.custom.MyFrameLayout3
|
||||||
android:id="@+id/small_container"
|
android:id="@+id/small_container"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginBottom="120dp"
|
android:layout_marginBottom="120dp"
|
||||||
app:mfl3_ratio="0.25"
|
app:mfl3_ratio="0.25" />
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -202,7 +211,26 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
android:src="@mipmap/zslk"
|
android:src="@mipmap/zslk"
|
||||||
android:visibility="gone"
|
android:visibility="gone" />
|
||||||
android:scaleType="centerCrop"/>
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/time_title"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="16.67dp"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@mipmap/live_pk_time_bg"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/pk_time"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="8sp" />
|
||||||
|
<!-- 详情-->
|
||||||
|
</FrameLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user