修复主播可以自己点整蛊拯救的问题

调整整蛊设置
This commit is contained in:
zlzw 2022-12-14 18:11:41 +08:00
parent 6929276512
commit b827f7bfa6
4 changed files with 27 additions and 5 deletions

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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() + "",

View File

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