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