fix:整蠱添加禮物新增一些限制提示

This commit is contained in:
zlzw 2022-12-13 11:24:31 +08:00
parent 6c33ac15f8
commit c9725875b3
6 changed files with 27 additions and 15 deletions

View File

@ -100,14 +100,18 @@ public class IMRTCManager {
@Override @Override
public void onSuccess() { public void onSuccess() {
callback.onSuccess(); callback.onSuccess();
if(!RandomPkManager.getInstance().isRandomModel()) {
ToastUtil.show("发起邀请成功"); ToastUtil.show("发起邀请成功");
}
requestUid.add(liveUid); requestUid.add(liveUid);
startRequestTimeoutTask(liveUid); startRequestTimeoutTask(liveUid);
} }
@Override @Override
public void onFailed(RTCErrorCode errorCode) { public void onFailed(RTCErrorCode errorCode) {
if(!RandomPkManager.getInstance().isRandomModel()) {
ToastUtil.show("邀请失败 " + errorCode.getValue()); 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);
} }

View File

@ -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()) {

View File

@ -254,17 +254,29 @@ 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);
try {
if (imm != null) { if (imm != null) {
imm.hideSoftInputFromWindow(dialog.getCurrentFocus().getWindowToken(), 0); 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(prangNum>=999){
ToastUtil.show("整蠱數量不能過大");
return;
}
if (WordUtil.isSpecialChar(prangContext)) { if (WordUtil.isSpecialChar(prangContext)) {
ToastUtil.show("整蠱內容不能包含特殊字符"); ToastUtil.show("整蠱內容不能包含特殊字符");
return; return;

View File

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

View File

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