From b827f7bfa64ba825343c5f57bcab777fd04b6246 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Wed, 14 Dec 2022 18:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E6=92=AD=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E8=87=AA=E5=B7=B1=E7=82=B9=E6=95=B4=E8=9B=8A=E6=8B=AF?= =?UTF-8?q?=E6=95=91=E7=9A=84=E9=97=AE=E9=A2=98=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=95=B4=E8=9B=8A=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/utils/StringUtil.java | 10 ++++++++++ .../java/com/yunbao/live/dialog/GiftPopDialog.java | 12 ++++++++---- .../yunbao/live/dialog/LivePrankDialogFragment.java | 5 +++++ .../com/yunbao/live/views/LiveRoomViewHolder.java | 5 ++++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/utils/StringUtil.java b/common/src/main/java/com/yunbao/common/utils/StringUtil.java index c32f2c9b2..b6bbc577a 100644 --- a/common/src/main/java/com/yunbao/common/utils/StringUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/StringUtil.java @@ -150,4 +150,14 @@ public class StringUtil { public static boolean isEmpty(String str) { return str == null || "".equals(str.trim()) || str.trim().length() == 0; } + + public static boolean isEmpty(String... str) { + for (String s : str) { + if (isEmpty(s)) { + return true; + } + + } + return false; + } } 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 5f7a3e74b..0fcae4596 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftPopDialog.java @@ -233,8 +233,12 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O public void onConfirmClick(Dialog dialog, String content) { try { prangNum = Integer.parseInt(content); - if (prangNum <= 0) { - ToastUtil.show("數量錯誤"); + if (prangNum <= 0 ) { + ToastUtil.show("數量不能為0或負數"); + return; + } + if(prangNum>999){ + ToastUtil.show("數量不能大於999"); return; } mBtnSend.setText(content); @@ -258,7 +262,7 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O if (imm != null) { imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0); } - }catch (Exception e){ + } catch (Exception e) { e.printStackTrace(); } dialog.dismiss(); @@ -273,7 +277,7 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O ToastUtil.show("整蠱內容或數量不能為空"); return; } - if(prangNum>=999){ + if (prangNum >= 999) { 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 1ec2cd4a6..ee39ac0c3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LivePrankDialogFragment.java @@ -25,6 +25,7 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DpUtil; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; import com.yunbao.live.adapter.LivePrankRecyclerAdapter; @@ -294,6 +295,10 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O } private void setPrankConfig() { + if(StringUtil.isEmpty(bean.getTurntable1(),bean.getTurntable2(), bean.getTurntable3(),bean.getTurntable4(),bean.getTurntable5(),bean.getTurntable6())){ + ToastUtil.show("保存失败:所有转盘位置必填" ); + return; + } LiveNetManager.get(mContext).setAnchorPrankTurntable( mLiveUid, bean.getCoin() + "", 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 bc4c0332e..e4f9a82f8 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -2920,7 +2920,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } - public void startAnchorLiveTime() { if (mLiveRoomHandler != null) { mLiveRoomHandler.sendEmptyMessageAtTime(LiveRoomHandler.WHAT_ANCHOR_LIVE_TIME, getNextTime(1000)); @@ -3567,6 +3566,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis lt_trickster_salvation.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + if (mContext instanceof LiveRyAnchorActivity) { + dialog.dismiss(); + return; + } hopeRankTurntable(); } });