From c9725875b3040dedff1a3fb91935e0848748777d Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 13 Dec 2022 11:24:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=95=B4=E8=A0=B1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A6=AE=E7=89=A9=E6=96=B0=E5=A2=9E=E4=B8=80=E4=BA=9B=E9=99=90?= =?UTF-8?q?=E5=88=B6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/manager/IMRTCManager.java | 8 ++++-- .../live/activity/LiveRyAnchorActivity.java | 1 - .../com/yunbao/live/dialog/GiftPopDialog.java | 26 ++++++++++++++----- .../live/dialog/LivePrankDialogFragment.java | 2 +- .../live/views/LivePushRyViewHolder.java | 3 --- .../yunbao/live/views/LiveRoomViewHolder.java | 2 +- 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/IMRTCManager.java b/common/src/main/java/com/yunbao/common/manager/IMRTCManager.java index 501daa08e..234faed65 100644 --- a/common/src/main/java/com/yunbao/common/manager/IMRTCManager.java +++ b/common/src/main/java/com/yunbao/common/manager/IMRTCManager.java @@ -100,14 +100,18 @@ public class IMRTCManager { @Override public void onSuccess() { callback.onSuccess(); - ToastUtil.show("发起邀请成功"); + if(!RandomPkManager.getInstance().isRandomModel()) { + ToastUtil.show("发起邀请成功"); + } requestUid.add(liveUid); startRequestTimeoutTask(liveUid); } @Override public void onFailed(RTCErrorCode errorCode) { - ToastUtil.show("邀请失败 " + errorCode.getValue()); + if(!RandomPkManager.getInstance().isRandomModel()) { + ToastUtil.show("邀请失败 " + errorCode.getValue()); + } if (RandomPkManager.getInstance().isRequestPk()) { RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE); } 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 1fe19cb63..0c2dfacca 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -164,7 +164,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl @Override public void onStartPK(String pkUid) { - ToastUtil.show("发起随机PK:" + pkUid); JSONObject msg1 = buildLinkMicJSON(); msg1.put("random_pk", "1"); if (RandomPkManager.getInstance().isRankModel()) { diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java b/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java index adb6bf7db..5f7a3e74b 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java @@ -254,28 +254,40 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O public void onConfirmClick(Dialog dialog, String content) { prangContext = content; mBtnContext.setText(content); - if (imm != null) { - imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0); + try { + if (imm != null) { + imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0); + } + }catch (Exception e){ + e.printStackTrace(); } dialog.dismiss(); } }); } else if (id == R.id.gift_btn) { - if (bean == null || StringUtil.isEmpty(prangContext) || prangNum == 0) { + if (bean == null) { + ToastUtil.show("整蠱禮物不能為空"); + return; + } + if (StringUtil.isEmpty(prangContext) || prangNum == 0) { ToastUtil.show("整蠱內容或數量不能為空"); return; } - if(WordUtil.isSpecialChar(prangContext)){ + if(prangNum>=999){ + ToastUtil.show("整蠱數量不能過大"); + return; + } + if (WordUtil.isSpecialChar(prangContext)) { ToastUtil.show("整蠱內容不能包含特殊字符"); return; } - if(prangContext.length()>6){ + if (prangContext.length() > 6) { ToastUtil.show("整蠱內容過長"); return; } - if(giftBeans!=null){ + if (giftBeans != null) { for (PrankGiftBean giftBean : giftBeans) { - if(giftBean.getGiftId().equals(bean.getId()+"")){ + if (giftBean.getGiftId().equals(bean.getId() + "")) { ToastUtil.show("整蠱禮物已存在"); return; } diff --git a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java index e95a4898b..1ec2cd4a6 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java @@ -136,7 +136,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O }); mPrankBtn.setOnClickListener(view -> { if ((int) view.getTag() == 1) { - if(giftBeans!=null&&giftBeans.size()>=20){ + if (giftBeans != null && giftBeans.size() >= 20) { ToastUtil.show("可添加禮物數量達到上限"); return; } 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 f0b5e36a1..ece604961 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -313,7 +313,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX } //单人PK,减掉次数 if (!RandomPkManager.getInstance().isRandomModel()) { - ToastUtil.show("单人PK,扣次数 = " + RandomPkManager.getInstance().getStatus()); LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback() { @Override public void onSuccess(HttpCallbackModel data) { @@ -325,8 +324,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX } }); - } else { - ToastUtil.show("随机PK,不扣次数"); } mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1); mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3); 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 d7bfdbaf3..a740bc551 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -3801,7 +3801,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis case PK_TWO_START: pkUid = event.getObject().toString(); UpPkTwo(); - initPkRank(); + new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank,300); break; case PK_TWO_END: closePkTwo();