新增IM消息:endPK,用于显示最终单人PK数据

This commit is contained in:
zlzw 2023-05-25 14:25:57 +08:00
parent 1b637b7a77
commit 99618a2779
7 changed files with 191 additions and 100 deletions

View File

@ -182,6 +182,7 @@ public class Constants {
public static final String LIVE_VOTE_CREATE="createVote"; public static final String LIVE_VOTE_CREATE="createVote";
public static final String LIVE_VOTE_UPDATE="updateVote"; public static final String LIVE_VOTE_UPDATE="updateVote";
public static final String LIVE_VOTE_END="endVote"; public static final String LIVE_VOTE_END="endVote";
public static final String LIVE_PK_END="endPK";//结束PK以这个PK获取到的参数为准
//游戏socket //游戏socket
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花 public static final String SOCKET_GAME_ZJH = "startGame";//炸金花

View File

@ -1,5 +1,7 @@
package com.yunbao.live.activity; package com.yunbao.live.activity;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
import android.app.Dialog; import android.app.Dialog;
import android.content.ClipData; import android.content.ClipData;
import android.content.ClipboardManager; import android.content.ClipboardManager;
@ -388,6 +390,17 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
} }
@Override
public void onEndPk(long leftUid, long rightUid, long left, long right, LivePKUserListBean bean) {
if (mLiveRyLinkMicPkPresenter != null) {
if (mLiveUid.equals(leftUid + "")) {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right, bean);
} else {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left, bean);
}
}
}
/** /**
* 收到弹幕消息 * 收到弹幕消息
*/ */
@ -1362,6 +1375,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
} }
/** /**
* 打开购买守护的弹窗 * 打开购买守护的弹窗
*/ */

View File

@ -206,13 +206,14 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
Log.d("RYM_DG", "Other onLeaveRoom: room = " + room.getRoomId()); Log.d("RYM_DG", "Other onLeaveRoom: room = " + room.getRoomId());
} }
}; };
public LiveRyLinkMicPkPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, View root) { public LiveRyLinkMicPkPresenter(Context context, ILiveLinkMicViewHolder linkMicViewHolder, boolean isAnchor, View root) {
mContext = context; mContext = context;
mIsAnchor = isAnchor; mIsAnchor = isAnchor;
mRoot = root; mRoot = root;
mPkContainer = linkMicViewHolder.getPkContainer(); mPkContainer = linkMicViewHolder.getPkContainer();
mPkTimeString1 = ""; mPkTimeString1 = "";
mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); mPkTimeString2 = mContext.getString(R.string.live_pk_time_2);
//从本地取数据 //从本地取数据
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
if (!pkTime.isEmpty()) { if (!pkTime.isEmpty()) {
@ -253,7 +254,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
mPkContainer = linkMicViewHolder.getPkContainer(); mPkContainer = linkMicViewHolder.getPkContainer();
livePushRyViewHolder = linkMicViewHolder; livePushRyViewHolder = linkMicViewHolder;
mPkTimeString1 = ""; mPkTimeString1 = "";
mPkTimeString2 =mContext.getString(R.string.live_pk_time_2); mPkTimeString2 = mContext.getString(R.string.live_pk_time_2);
//从本地取数据 //从本地取数据
String pkTime = CommonAppConfig.getInstance().getAnchorPkTime(); String pkTime = CommonAppConfig.getInstance().getAnchorPkTime();
if (!pkTime.isEmpty()) { if (!pkTime.isEmpty()) {
@ -2184,6 +2185,18 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
nextPkTimeCountDown(2); nextPkTimeCountDown(2);
} }
/**
* 修改最终PK数据
* @param leftGift 左边数据
* @param rightGift 右边数据
* @param bean 排位数据
*/
public void onPkProgressEnd(long leftGift, long rightGift,LivePKUserListBean bean) {
if (mLiveLinkMicPkViewHolder != null) {
mLiveLinkMicPkViewHolder.onProgressChanged(leftGift, rightGift, bean, true);
}
}
/** /**
* 进房间的时候懲罰开始 * 进房间的时候懲罰开始
@ -2312,7 +2325,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
// //恢复播放画面 // //恢复播放画面
if (i == 1) { if (i == 1) {
if(btn_close!=null){ if (btn_close != null) {
btn_close.setVisibility(View.GONE); btn_close.setVisibility(View.GONE);
} }
if (rtcRoom != null) { if (rtcRoom != null) {

View File

@ -290,6 +290,16 @@ public interface SocketMessageListener {
*/ */
void onPrizePoolUp(String level); void onPrizePoolUp(String level);
/**
* 最终PK数据
* @param leftUid 左边uid
* @param rightUid 右边uid
* @param left 左边分数
* @param right 右边分数
* @param bean 排位顺序
*/
void onEndPk(long leftUid,long rightUid,long left,long right,LivePKUserListBean bean);
/***********************以下是游戏*********************************/ /***********************以下是游戏*********************************/
/** /**
* 游戏 智勇三张 游戏的回调 * 游戏 智勇三张 游戏的回调

View File

@ -7,8 +7,10 @@ import static com.yunbao.live.views.LivePushRyViewHolder.rtcRoom;
import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot; import static com.yunbao.live.views.LiveRoomViewHolder.getIsHot;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
@ -38,6 +40,7 @@ import com.yunbao.common.http.HttpClient;
import com.yunbao.common.manager.IMRTCManager; import com.yunbao.common.manager.IMRTCManager;
import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.manager.RandomPkManager;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
@ -64,6 +67,8 @@ import org.greenrobot.eventbus.EventBus;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.List; import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback; import cn.rongcloud.rtc.api.callback.IRCRTCResultCallback;
import cn.rongcloud.rtc.base.RTCErrorCode; import cn.rongcloud.rtc.base.RTCErrorCode;
@ -650,6 +655,14 @@ public class SocketRyClient {
.setObject(map) .setObject(map)
); );
break; break;
case Constants.LIVE_PK_END:
mListener.onEndPk(map.getLong("uid"),
map.getLong("pkuid"),
map.getLong("uid_score"),
map.getLong("pkuid_score"),
JSONObject.parseObject(map.getJSONObject("ct").getJSONObject("pk_top_users").toJSONString(), LivePKUserListBean.class)
);
break;
} }
} }

View File

@ -5,6 +5,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.graphics.Path; import android.graphics.Path;
import android.graphics.PathMeasure; import android.graphics.PathMeasure;
import android.graphics.RectF; import android.graphics.RectF;
@ -84,8 +85,8 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
public void init() { public void init() {
mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2; mHalfScreenWidth = ScreenDimenUtil.getInstance().getScreenWdith() / 2;
mLeftString =mContext.getString(R.string.live_link_mic_pk_1); mLeftString = mContext.getString(R.string.live_link_mic_pk_1);
mRightString =mContext.getString(R.string.live_link_mic_pk_2); mRightString = mContext.getString(R.string.live_link_mic_pk_2);
mFrameImageView = (FrameImageView) findViewById(R.id.frame_img); mFrameImageView = (FrameImageView) findViewById(R.id.frame_img);
mFrameImageView.setImageList(LiveIconUtil.getLinkMicPkAnim());//PK开始动画 mFrameImageView.setImageList(LiveIconUtil.getLinkMicPkAnim());//PK开始动画
frame_img_pk = (ImageView) findViewById(R.id.frame_img_pk); frame_img_pk = (ImageView) findViewById(R.id.frame_img_pk);
@ -155,7 +156,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.i("女神说", "倒计时状态:"+s); Log.i("女神说", "倒计时状态:" + s);
if (mTime.getVisibility() == View.VISIBLE) { if (mTime.getVisibility() == View.VISIBLE) {
EventBus.getDefault().post(new LiveAudienceEvent() EventBus.getDefault().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING)); .setType(LiveAudienceEvent.LiveAudienceType.LIVE_PK_ING));
@ -198,6 +199,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground(); animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
animationDrawable.start(); animationDrawable.start();
} }
mLeft.setTag(null);
} }
public void showTime() { public void showTime() {
@ -233,6 +235,7 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
} }
if (mLeft != null) { if (mLeft != null) {
mLeft.setTranslationX(0); mLeft.setTranslationX(0);
mLeft.setTag(null);
mLeft2.setTranslationX(0); mLeft2.setTranslationX(0);
} }
if (mRight != null) { if (mRight != null) {
@ -241,7 +244,27 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
} }
} }
/**
* 修改PK进度条进度
* @param leftGift 左边进度
* @param rightGift 右边进度
* @param bean 排位信息
*/
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean) { public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean) {
onProgressChanged(leftGift, rightGift, bean, false);
}
/**
* 修改PK进度条进度
* @param leftGift 左边进度
* @param rightGift 右边进度
* @param bean 排位信息
* @param isEnd 是否为最终数据是的话就不再接收后续修改数据默认false
*/
public void onProgressChanged(long leftGift, long rightGift, LivePKUserListBean bean, boolean isEnd) {
if (mLeft.getTag() != null && ((boolean) mLeft.getTag())) {
return;
}
mLeft.setText(mLeftString + " " + leftGift); mLeft.setText(mLeftString + " " + leftGift);
mRight.setText(rightGift + " " + mRightString); mRight.setText(rightGift + " " + mRightString);
if (leftGift == rightGift) { if (leftGift == rightGift) {
@ -262,8 +285,10 @@ public class LiveLinkMicPkViewHolder extends AbsViewHolder {
animationDrawable = (AnimationDrawable) frame_img_pk.getBackground(); animationDrawable = (AnimationDrawable) frame_img_pk.getBackground();
animationDrawable.start(); animationDrawable.start();
} }
mLeft.setTag(isEnd);
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean)); if (bean != null) {
EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.PK_TWO_UPDATE_HEAD_DATA).setLivePKUserListBean(bean));
}
} }
private void changeLine(float nowIndex, long leftGift, long rightGift) { private void changeLine(float nowIndex, long leftGift, long rightGift) {

View File

@ -1,6 +1,7 @@
package com.yunbao.live.views; package com.yunbao.live.views;
import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive; import static com.yunbao.live.views.LiveRoomViewHolder.isStayRoomfive;
import static com.yunbao.live.views.LiveRoomViewHolder.mLiveUid;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
@ -9,6 +10,7 @@ import android.content.res.Configuration;
import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.AnimationDrawable;
import android.os.CountDownTimer; import android.os.CountDownTimer;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -95,6 +97,8 @@ import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
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;
@ -269,105 +273,105 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void run() { public void run() {
try{ try {
Log.e("ImgLoader1", data.getAvatar()); Log.e("ImgLoader1", data.getAvatar());
if (mLiveRyLinkMicPkPresenter != null) { if (mLiveRyLinkMicPkPresenter != null) {
mLiveRyLinkMicPkPresenter.clearData(); mLiveRyLinkMicPkPresenter.clearData();
mLiveRyLinkMicPkPresenter.release(); mLiveRyLinkMicPkPresenter.release();
mLiveRyLinkMicPkPresenter = null; mLiveRyLinkMicPkPresenter = null;
} }
mLiveBean = data; mLiveBean = data;
mLiveSDK = liveSdk; mLiveSDK = liveSdk;
mLiveType = liveType; mLiveType = liveType;
mLiveTypeVal = liveTypeVal; mLiveTypeVal = liveTypeVal;
liveID = data.getUid(); liveID = data.getUid();
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS) .setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(openParametersModel .setParametersModel(openParametersModel
.setmLiveType(mLiveType) .setmLiveType(mLiveType)
.setmLiveTypeVal(mLiveTypeVal))); .setmLiveTypeVal(mLiveTypeVal)));
loading.setVisibility(View.VISIBLE); loading.setVisibility(View.VISIBLE);
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg); ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), ivBg);
AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground(); AnimationDrawable frameAnimation = (AnimationDrawable) ivLoading.getBackground();
frameAnimation.start(); frameAnimation.start();
liveHandler.removeCallbacks(loadRunnableGone); liveHandler.removeCallbacks(loadRunnableGone);
if (mLivePlayViewHolder == null) { if (mLivePlayViewHolder == null) {
mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1); mLivePlayViewHolder = new LivePlayRyViewHolder(mContext, playContainer, 1);
mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager()); mLiveRoomViewHolder = new LiveRoomViewHolder(false, 1, mContext, mContainer, mSecondPage.findViewById(R.id.gift_gif), mSecondPage.findViewById(R.id.gift_svga), mContainerWrap, mContext.getWindowManager());
mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer); mLiveAudienceViewHolder = new LiveAudienceViewHolder(mContext, mContainer);
mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView()); mLiveLinkMicPresenter = new LiveLinkMicPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, mLiveAudienceViewHolder.getContentView());
mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null); mLiveLinkMicAnchorPresenter = new LiveLinkMicAnchorPresenter(mContext, mLivePlayViewHolder, false, mLiveSDK, null);
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
mLivePlayViewHolder.addToParent(); mLivePlayViewHolder.addToParent();
mLivePlayViewHolder.subscribeActivityLifeCycle(); mLivePlayViewHolder.subscribeActivityLifeCycle();
mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() { mLivePlayViewHolder.setLoadViewListener(new LiveRoomPlayViewHolder.LoadingListener() {
@Override
public void onPlayer() {
liveHandler.postDelayed(loadRunnableGone, 350);
}
});
mLiveRoomViewHolder.subscribeActivityLifeCycle();
mLiveAudienceViewHolder.addToParent();
mLiveRoomViewHolder.addToParent();
mLiveAudienceViewHolder.subscribeActivityLifeCycle();
} else {
mLivePlayViewHolder.setLiveBeanLandscape(1);
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK);
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK);
}
if (mLiveRyLinkMicPkPresenter == null) {
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null);
}
//去除主播离开画面
if (LivePlayKsyViewHolder.leave != null) {
LivePlayKsyViewHolder.leave.setVisibility(View.GONE);
}
if (LivePlayRyViewHolder.leave != null) {
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
}
//直播间背景
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
mask.setVisibility(View.VISIBLE);
mLivePlayViewHolder.clearFrame();
mLivePlayViewHolder.setLiveBean(mLiveBean);
mLivePlayViewHolder.removeDetailView();
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape());
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
@Override @Override
public void onPlayer() { public void onMikUpdate() {
liveHandler.postDelayed(loadRunnableGone, 350); if (mContext instanceof LiveActivity) {
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
}
} }
}); });
mLiveRoomViewHolder.subscribeActivityLifeCycle(); mLiveRoomViewHolder.resetView();
mLiveAudienceViewHolder.addToParent(); enterRoomModel.clear();
mLiveRoomViewHolder.addToParent(); enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
mLiveAudienceViewHolder.subscribeActivityLifeCycle(); mLiveRoomViewHolder.setAvatar(data.getAvatar());
} else { mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
mLivePlayViewHolder.setLiveBeanLandscape(1); mLiveRoomViewHolder.setName(data.getUserNiceName());
mLiveLinkMicPresenter.setLiveSdk(mLiveSDK); mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
mLiveLinkMicAnchorPresenter.setLiveSdk(mLiveSDK); mLiveRoomViewHolder.setTitle(data.getTitle());
} mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
mLiveRoomViewHolder.clearGuardIcon();
if (mLiveRyLinkMicPkPresenter == null) { mLiveRoomViewHolder.clearChat();
mLiveRyLinkMicPkPresenter = new LiveRyLinkMicPkPresenter(mContext, mLivePlayViewHolder, false, null); mLiveRoomViewHolder.releaseGift();
} mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
//去除主播离开画面 mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext);
if (LivePlayKsyViewHolder.leave != null) { if (mLiveLinkMicPresenter != null) {
LivePlayKsyViewHolder.leave.setVisibility(View.GONE); mLiveLinkMicPresenter.setSocketClient(mSocketClient);
}
if (LivePlayRyViewHolder.leave != null) {
LivePlayRyViewHolder.leave.setVisibility(View.GONE);
}
//直播间背景
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack, 400, 600);
mask.setVisibility(View.VISIBLE);
mLivePlayViewHolder.clearFrame();
mLivePlayViewHolder.setLiveBean(mLiveBean);
mLivePlayViewHolder.removeDetailView();
mLivePlayViewHolder.setCover(mLiveBean.getAvatar());
mLivePlayViewHolder.setLiveBeanLandscape(mLiveBean.getLandscape());
mLiveRoomViewHolder.changeMessageLandscape(mLiveBean.getLandscape());
//mLivePlayViewHolder.play(mLiveBean.getPull(), LiveRoomPlayViewHolder.PLAY_MODEL_DEF);
mLivePlayViewHolder.setOnMicCallback(new LiveRoomPlayViewHolder.OnMicCallback() {
@Override
public void onMikUpdate() {
if (mContext instanceof LiveActivity) {
((LiveActivity) mContext).showMicList(mLiveBean.getUid(), mLiveRoomViewHolder);
}
} }
}); enterRoomNew();
mLiveRoomViewHolder.resetView();
enterRoomModel.clear();
enterRoomLeaveHandler.removeCallbacks(enterRoomLeaveRunnable);
mLiveRoomViewHolder.setAvatar(data.getAvatar());
mLiveRoomViewHolder.setAnchorLevel(data.getLevelAnchor());
mLiveRoomViewHolder.setName(data.getUserNiceName());
mLiveRoomViewHolder.setRoomNum(data.getLiangNameTip());
mLiveRoomViewHolder.setTitle(data.getTitle());
mLiveRoomViewHolder.setAnchorGoodNumber(data.getGoodNum());
mLiveRoomViewHolder.clearGuardIcon();
mLiveRoomViewHolder.clearChat();
mLiveRoomViewHolder.releaseGift();
mLiveRyLinkMicPkPresenter.setLiveUid(data.getUid(), "");
mSocketRyClient = new SocketRyClient(mLiveBean.getUid(), PortraitLiveManager.this, mContext);
if (mLiveLinkMicPresenter != null) {
mLiveLinkMicPresenter.setSocketClient(mSocketClient);
}
enterRoomNew();
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -1173,6 +1177,17 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
@Override
public void onEndPk(long leftUid, long rightUid, long left, long right,LivePKUserListBean bean) {
if (mLiveRyLinkMicPkPresenter != null) {
if (mLiveUid.equals(leftUid + "")) {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(left, right,bean);
} else {
mLiveRyLinkMicPkPresenter.onPkProgressEnd(right, left,bean);
}
}
}
@Override @Override
public void onSendDanMu(LiveDanMuBean bean) { public void onSendDanMu(LiveDanMuBean bean) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {