fix:整蠱添加禮物新增一些限制提示
This commit is contained in:
parent
6c33ac15f8
commit
c9725875b3
@ -100,14 +100,18 @@ public class IMRTCManager {
|
|||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
callback.onSuccess();
|
callback.onSuccess();
|
||||||
ToastUtil.show("发起邀请成功");
|
if(!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
ToastUtil.show("发起邀请成功");
|
||||||
|
}
|
||||||
requestUid.add(liveUid);
|
requestUid.add(liveUid);
|
||||||
startRequestTimeoutTask(liveUid);
|
startRequestTimeoutTask(liveUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(RTCErrorCode errorCode) {
|
public void onFailed(RTCErrorCode errorCode) {
|
||||||
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
if(!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
|
ToastUtil.show("邀请失败 " + errorCode.getValue());
|
||||||
|
}
|
||||||
if (RandomPkManager.getInstance().isRequestPk()) {
|
if (RandomPkManager.getInstance().isRequestPk()) {
|
||||||
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
RandomPkManager.getInstance().setPkStatus(RandomPkManager.PK_STATUS_REFUSE);
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,6 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStartPK(String pkUid) {
|
public void onStartPK(String pkUid) {
|
||||||
ToastUtil.show("发起随机PK:" + pkUid);
|
|
||||||
JSONObject msg1 = buildLinkMicJSON();
|
JSONObject msg1 = buildLinkMicJSON();
|
||||||
msg1.put("random_pk", "1");
|
msg1.put("random_pk", "1");
|
||||||
if (RandomPkManager.getInstance().isRankModel()) {
|
if (RandomPkManager.getInstance().isRankModel()) {
|
||||||
|
@ -254,28 +254,40 @@ public class GiftPopDialog extends PopupWindow implements ActionListener, View.O
|
|||||||
public void onConfirmClick(Dialog dialog, String content) {
|
public void onConfirmClick(Dialog dialog, String content) {
|
||||||
prangContext = content;
|
prangContext = content;
|
||||||
mBtnContext.setText(content);
|
mBtnContext.setText(content);
|
||||||
if (imm != null) {
|
try {
|
||||||
imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0);
|
if (imm != null) {
|
||||||
|
imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0);
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (id == R.id.gift_btn) {
|
} 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("整蠱內容或數量不能為空");
|
ToastUtil.show("整蠱內容或數量不能為空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(WordUtil.isSpecialChar(prangContext)){
|
if(prangNum>=999){
|
||||||
|
ToastUtil.show("整蠱數量不能過大");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (WordUtil.isSpecialChar(prangContext)) {
|
||||||
ToastUtil.show("整蠱內容不能包含特殊字符");
|
ToastUtil.show("整蠱內容不能包含特殊字符");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(prangContext.length()>6){
|
if (prangContext.length() > 6) {
|
||||||
ToastUtil.show("整蠱內容過長");
|
ToastUtil.show("整蠱內容過長");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(giftBeans!=null){
|
if (giftBeans != null) {
|
||||||
for (PrankGiftBean giftBean : giftBeans) {
|
for (PrankGiftBean giftBean : giftBeans) {
|
||||||
if(giftBean.getGiftId().equals(bean.getId()+"")){
|
if (giftBean.getGiftId().equals(bean.getId() + "")) {
|
||||||
ToastUtil.show("整蠱禮物已存在");
|
ToastUtil.show("整蠱禮物已存在");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ public class LivePrankDialogFragment extends AbsDialogFragment implements View.O
|
|||||||
});
|
});
|
||||||
mPrankBtn.setOnClickListener(view -> {
|
mPrankBtn.setOnClickListener(view -> {
|
||||||
if ((int) view.getTag() == 1) {
|
if ((int) view.getTag() == 1) {
|
||||||
if(giftBeans!=null&&giftBeans.size()>=20){
|
if (giftBeans != null && giftBeans.size() >= 20) {
|
||||||
ToastUtil.show("可添加禮物數量達到上限");
|
ToastUtil.show("可添加禮物數量達到上限");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
}
|
}
|
||||||
//单人PK,减掉次数
|
//单人PK,减掉次数
|
||||||
if (!RandomPkManager.getInstance().isRandomModel()) {
|
if (!RandomPkManager.getInstance().isRandomModel()) {
|
||||||
ToastUtil.show("单人PK,扣次数 = " + RandomPkManager.getInstance().getStatus());
|
|
||||||
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
LiveNetManager.get(mContext).setFreePkNum(new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(HttpCallbackModel data) {
|
public void onSuccess(HttpCallbackModel data) {
|
||||||
@ -325,8 +324,6 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
ToastUtil.show("随机PK,不扣次数");
|
|
||||||
}
|
}
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
mLiveRyLinkMicPkPresenter.onLinkMicToPk(userBean1);
|
||||||
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3);
|
mLiveRyLinkMicPkPresenter.onLinkMicPkStart(inviteeRoomId, 3);
|
||||||
|
@ -3801,7 +3801,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
case PK_TWO_START:
|
case PK_TWO_START:
|
||||||
pkUid = event.getObject().toString();
|
pkUid = event.getObject().toString();
|
||||||
UpPkTwo();
|
UpPkTwo();
|
||||||
initPkRank();
|
new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank,300);
|
||||||
break;
|
break;
|
||||||
case PK_TWO_END:
|
case PK_TWO_END:
|
||||||
closePkTwo();
|
closePkTwo();
|
||||||
|
Loading…
Reference in New Issue
Block a user