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();