From 1407ecc2f2cd58939da5475deea54c09b2dfe653 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 14 Dec 2022 16:45:43 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=8F=E6=9C=BAPK?= =?UTF-8?q?=E5=A4=A9=E6=A2=AF=E8=B5=9B=E4=B8=8D=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 ++-- .../yunbao/live/presenter/LiveRyLinkMicPkPresenter.java | 4 ++-- .../java/com/yunbao/live/views/LivePushRyViewHolder.java | 2 +- .../java/com/yunbao/live/views/LiveRoomViewHolder.java | 9 +++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/config.gradle b/config.gradle index f139351ac..920428bb0 100644 --- a/config.gradle +++ b/config.gradle @@ -10,9 +10,9 @@ ext { manifestPlaceholders = [ //正式 - serverHost : "https://napi.yaoulive.com", + //serverHost : "https://napi.yaoulive.com", // 測試 -// serverHost : "https://ceshi.yaoulive.com", + serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", 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 ae81dcdd1..a79ba318b 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -866,8 +866,8 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { LiveRyAnchorActivity.isDRPK = 1; LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE); SocketRyLinkMicPkUtil.linkMicPkAccept(mSocketRyClient, mApplyUid, mApplyUrl, mApplyNmae); + EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO).setObject(mApplyUid)); onLinkMicPkStart(mApplyUid, 2); - EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO)); } }); } @@ -1408,7 +1408,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { ToastUtil.show("接受失败"); } }); - }else { + } else { ToastUtil.show(msg); } } 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 bb1e810f5..1caa73c35 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -331,7 +331,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX } mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1); mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3); - EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO)); + EventBus.getDefault().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.UP_PK_TWO).setObject(userBean1.getId())); } } }); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 56003c782..ce63a5791 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -89,6 +89,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.manager.IMLoginManager; +import com.yunbao.common.manager.RandomPkManager; import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.DeviceUtils; import com.yunbao.common.utils.DialogUitl; @@ -99,6 +100,7 @@ import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ScreenDimenUtil; import com.yunbao.common.utils.SpUtil; import com.yunbao.common.utils.StringUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.views.AbsViewHolder; @@ -1971,6 +1973,11 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis uidR2 = ""; uidR1 = ""; uidR3 = ""; + + if (RandomPkManager.getInstance().isRandomModel()) { + RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_START); + } + new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank, 300); } //双人pk关闭 @@ -3823,6 +3830,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis endDRGif(); break; case UP_PK_TWO: + pkUid = (String) event.getObject(); + ToastUtil.show("对方UID=" + pkUid); UpPkTwo(); break; } From d49b60a1e1e9a8af73851aa436189900a943361d Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 14 Dec 2022 17:13:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E6=92=AD?= =?UTF-8?q?=E9=97=B4=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=9D=93=E5=8F=B7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/activity/LiveRyAnchorActivity.java | 1 + .../main/java/com/yunbao/live/views/LiveRoomViewHolder.java | 1 + .../main/java/com/yunbao/live/views/PortraitLiveManager.java | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) 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 4b567190b..a951c8f14 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -730,6 +730,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.startAnchorLiveTime(); mLiveRoomViewHolder.startAnchorCheckLive(); + mLiveRoomViewHolder.setAnchorGoodNumber(obj.getString("goodnum")); } mStartLive = true; mLiveRoomViewHolder.startRefreshUserList(); diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index ce63a5791..787aba470 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -3205,6 +3205,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void setAnchorGoodNumber(String goodNumber) { if (!StringUtil.isEmpty(goodNumber) && !goodNumber.equals("0")) { mAnchorLayout.setBackgroundResource(R.drawable.bg_live_anchor_goodnum); + mID.setText(goodNumber); mGoodNumberIcon.setVisibility(View.VISIBLE); } } diff --git a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java index 0694f8dfd..f74108a76 100644 --- a/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java +++ b/live/src/main/java/com/yunbao/live/views/PortraitLiveManager.java @@ -366,6 +366,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setGuardIcon(data.getGuardUserAvatar()); //在线列表 mLiveRoomViewHolder.setUserList(data.getEnterRoomInfo().getUserlists()); + //设置靓号 + mLiveRoomViewHolder.setAnchorGoodNumber(data.getLiveInfo().getGoodnum()); List bannerBeans = new ArrayList<>(); //心愿单 if (data.getWishList().getWishList().size() > 0) { @@ -506,7 +508,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe mLiveRoomViewHolder.setOtherInfo(pkInfo.getString("pkuid"), pkInfo.getString("pkuimg"), pkInfo.getString("pkuname")); } }; - linkMicPkStartHandler.postDelayed(linkMicPkStartRunnable,4000); + linkMicPkStartHandler.postDelayed(linkMicPkStartRunnable, 4000); } mLiveRyLinkMicPkPresenter.onEnterRoomPkStart(pkUid, pkInfo.getLongValue("pk_gift_liveuid"), pkInfo.getLongValue("pk_gift_pkuid"), pkInfo.getIntValue("pk_time"), livePKUserListBean); From f359c9994daf4c6217ef65f8eb43b906fcd93065 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 14 Dec 2022 17:25:03 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPK=E8=BF=87=E7=A8=8B?= =?UTF-8?q?=E4=B8=AD=E5=8F=AF=E4=BB=A5=E5=86=8D=E6=AC=A1=E6=89=93=E5=BC=80?= =?UTF-8?q?PK=E5=AF=B9=E8=AF=9D=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/activity/LiveRyAnchorActivity.java | 14 +++++++++++--- .../yunbao/live/dialog/RandomPkDialogFragment.java | 4 ++-- .../live/presenter/LiveRyLinkMicPkPresenter.java | 3 ++- .../yunbao/live/views/LivePushRyViewHolder.java | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) 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 a951c8f14..79cfbfd92 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -289,7 +289,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl break; case Constants.LIVE_FUNC_MIC://語音 //ToastUtil.show("開發中,敬請期待"); - openMicWindow(1); + if (isDRPK != 1) { + openMicWindow(1); + } else { + ToastUtil.show("您已在PK中"); + } break; case Constants.LIVE_FUNC_DR://多人PK if (isDRPK != 1) { @@ -430,7 +434,11 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl } break; case Constants.LIVE_FUNC_RANDOM_PK: - openRandomPkWindow(); + if (isDRPK != 1) { + openRandomPkWindow(); + } else { + ToastUtil.show("您已在PK中"); + } break; default: break; @@ -730,7 +738,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.startAnchorLiveTime(); mLiveRoomViewHolder.startAnchorCheckLive(); - mLiveRoomViewHolder.setAnchorGoodNumber(obj.getString("goodnum")); + mLiveRoomViewHolder.setAnchorGoodNumber(obj.getString("goodnum")); } mStartLive = true; mLiveRoomViewHolder.startRefreshUserList(); diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index aaae1d485..a8552e9aa 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -135,7 +135,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On mRandomPkSwitch.setOnClickListener(this); mPkBtn.setOnClickListener(this); mPkBtn.setTag(false); - /*mPkBtn.setOnLongClickListener(v -> { + mPkBtn.setOnLongClickListener(v -> { DialogUitl.showSimpleInputDialog(mContext, "输入指定UID", new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { @@ -145,7 +145,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On } }); return false; - });*/ + }); } private void initData() { 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 a79ba318b..370ce2659 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveRyLinkMicPkPresenter.java @@ -703,7 +703,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { } }); LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE); - + LiveRyAnchorActivity.isDRPK=1; ScreenDimenUtil util = ScreenDimenUtil.getInstance(); int mScreenWdith = util.getScreenWdith(); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mScreenWdith * 720 / 960); @@ -757,6 +757,7 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener { LivePushRyViewHolder.mPreView1.setLayoutParams(params); LivePushRyViewHolder.mPreView1.setVisibility(View.VISIBLE); LivePushRyViewHolder.btn_close.setVisibility(View.VISIBLE); + LiveRyAnchorActivity.isDRPK=1; JSONObject msg1 = new JSONObject(); msg1.put("uid", CommonAppConfig.getInstance().getUid()); 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 1caa73c35..332a17a85 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -387,7 +387,7 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX @Override public void onConfirmClick(Dialog dialog, String content) { //断开连麦 - + LiveRyAnchorActivity.isDRPK=0; HttpClient.getInstance().post("livepk.setliveuserout", "livepk.setliveuserout") .execute(new HttpCallback() { @Override From 64c33f570901d0713d27923591089f3d70899a5a Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 14 Dec 2022 17:33:22 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=B4=E8=9B=8A?= =?UTF-8?q?=E7=9A=84UI=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- live/src/main/res/layout/item_random_pk_rv.xml | 6 +++--- live/src/main/res/layout/view_live_prank_turntable.xml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/live/src/main/res/layout/item_random_pk_rv.xml b/live/src/main/res/layout/item_random_pk_rv.xml index b43334e37..c5a16f178 100644 --- a/live/src/main/res/layout/item_random_pk_rv.xml +++ b/live/src/main/res/layout/item_random_pk_rv.xml @@ -14,7 +14,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="10dp" - android:layout_weight="1" + android:layout_weight="0.7" android:text="序号" android:textColor="#FFFFFF" android:textSize="14sp" /> @@ -22,7 +22,7 @@ diff --git a/live/src/main/res/layout/view_live_prank_turntable.xml b/live/src/main/res/layout/view_live_prank_turntable.xml index ccb1f7599..a9cf3d879 100644 --- a/live/src/main/res/layout/view_live_prank_turntable.xml +++ b/live/src/main/res/layout/view_live_prank_turntable.xml @@ -7,6 +7,7 @@ Date: Wed, 14 Dec 2022 17:40:52 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=A7=BB=E9=99=A4DEBUG=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/live/dialog/RandomPkDialogFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index a8552e9aa..2503ee80a 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -135,7 +135,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On mRandomPkSwitch.setOnClickListener(this); mPkBtn.setOnClickListener(this); mPkBtn.setTag(false); - mPkBtn.setOnLongClickListener(v -> { + /* mPkBtn.setOnLongClickListener(v -> { DialogUitl.showSimpleInputDialog(mContext, "输入指定UID", new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { @@ -145,7 +145,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On } }); return false; - }); + });*/ } private void initData() {