diff --git a/config.gradle b/config.gradle index 37ecbef9b..920428bb0 100644 --- a/config.gradle +++ b/config.gradle @@ -10,7 +10,7 @@ ext { manifestPlaceholders = [ //正式 -// serverHost : "https://napi.yaoulive.com", + //serverHost : "https://napi.yaoulive.com", // 測試 serverHost : "https://ceshi.yaoulive.com", 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 d5fd2134e..ae79b5bb8 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; @@ -732,6 +740,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/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index aaae1d485..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) { 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..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()); @@ -866,8 +867,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 +1409,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..332a17a85 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())); } } }); @@ -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 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 b255d29a3..bc4c0332e 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; @@ -1967,6 +1969,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关闭 @@ -3185,6 +3192,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); } } @@ -3807,6 +3815,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; } 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); 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 @@