diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index fb294a2ef..2536baf6c 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -80,9 +80,9 @@ public class CommonAppConfig { public static String SWToken = ""; //声网Token public static final String SWChannelPrefix = "g"; //测试服 - //public static final String SWAPPId = "4cf0376582d742ac8a96778b25b1079e"; + public static final String SWAPPId = "4cf0376582d742ac8a96778b25b1079e"; //正式服 - public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21"; + //public static final String SWAPPId = "d4a5879524d74c20a7bdd667b0f2ca21"; 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 78c9dbf64..a4240d206 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -165,7 +165,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl private boolean mPaused; String mBeautySdkType; public static int isDRPK = 0; - public static int DRPKing = 0; // 0 多人PK前 1 多人PK中 2多人PK后 + public static int DRPKing = -1; //-1 未发起多人PK 0 多人PK前 1 多人PK中 2多人PK后 public static boolean PKing = false; public static int pk_nub; public static int backIndex = 0;//0=未判断,1=已判断 @@ -874,7 +874,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl MicUserManager.get().removeAllMicUserList(); PKing = false; isDRPK = 0; - DRPKing = 0; + DRPKing = -1; endLive(); RandomPkManager.getInstance().release(); } 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 625805231..4ee743c42 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java @@ -567,7 +567,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { pkScores.remove(removeUid); upDataPkScore(pkScores,"-1",0,false); } - }, 1000); + }, 100); } @@ -802,6 +802,11 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { private String TAG = "多人PK"; + + public void editPkRoom(String uid){ + SWManager.get().exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()), uid); + } + /** * 退出多人PK */ @@ -1252,12 +1257,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { linearGrade1.setVisibility(View.GONE); } - - public void setPkUserInfoView(UserBean userBean) { - - } - - //多人PK接受申请画 加入副房间 + //多人PK接受申请画 public void dRjoinOtherRoom(UserBean u) { L.eSw("dRjoinOtherRoom UserBeanUserBeanUserBeanUserBeanUserBeanUserBeanUserBeanUserBean "); setMyDrPkDetailsView(); @@ -1972,7 +1972,9 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { mHandler.sendEmptyMessageAtTime(WHAT_PK_TIME2, getNextSecondTime()); } } else { - mLiveAnchorViewHolder.showEndPkBt(); + if(DRPKing!=-1){ + mLiveAnchorViewHolder.showEndPkBt(); + } livePushSwViewHolder.timeTitle.setVisibility(View.GONE); if (mHandler != null) { mHandler.removeCallbacksAndMessages(null); diff --git a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java index 16f6c2eb1..bb4aa29e7 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketSwClient.java @@ -335,6 +335,7 @@ public class SocketSwClient { DRPKing = 1; } else if (action3 == 5) {//结束PK // endDRGif(); + DRPKing= -1; LiveRoomViewHolder.d_pk_view.setVisibility(View.GONE); if (LiveSwAnchorActivity.mLiveAnchorViewHolder != null) { LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); diff --git a/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java index 03924503e..f3c5192b9 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushSwViewHolder.java @@ -344,8 +344,6 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX } } }); - - mLiveSwLinkMicPkPresenter.setPkUserInfoView(u); } private int currentPosition = 0; @@ -396,7 +394,10 @@ public class LivePushSwViewHolder extends AbsRyLivePushViewHolder implements ITX } public void anchorClose() { + swManager.exitChannelToUid(Integer.parseInt(CommonAppConfig.getInstance().getUid()),pkUid1); swManager.updateMyChannelView((FrameLayout) mBigContainer); //用户主动断开连麦再退出画面 + mPkContainer.setVisibility(View.GONE); + pkUid1 = null; } public void onLinkMicAnchorClose() { diff --git a/live/src/main/res/layout/view_live_pk_details.xml b/live/src/main/res/layout/view_live_pk_details.xml index 1fa312eb6..f7fcfb9d5 100644 --- a/live/src/main/res/layout/view_live_pk_details.xml +++ b/live/src/main/res/layout/view_live_pk_details.xml @@ -5,8 +5,9 @@ @@ -60,8 +61,9 @@