fix:整蠱添加禮物新增一些限制提示
This commit is contained in:
parent
6c33ac15f8
commit
c9725875b3
@ -100,14 +100,18 @@ public class IMRTCManager {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
callback.onSuccess();
|
||||
if(!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("发起邀请成功");
|
||||
}
|
||||
requestUid.add(liveUid);
|
||||
startRequestTimeoutTask(liveUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(RTCErrorCode errorCode) {
|
||||
if(!RandomPkManager.getInstance().isRandomModel()) {
|
||||
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||
}
|
||||
if (RandomPkManager.getInstance().isRequestPk()) {
|
||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||
}
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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<HttpCallbackModel>() {
|
||||
@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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user