update 随机PK 补充拒绝PK后的对话框

This commit is contained in:
zlzw 2022-12-10 14:58:50 +08:00
parent e28c393f88
commit 3a75e24601
3 changed files with 11 additions and 5 deletions

View File

@ -87,7 +87,6 @@ public class RandomPkManager {
@Override @Override
public void run() { public void run() {
status = PK_STATUS_REQUEST;
sec++; sec++;
if (sec % 60 == 0) { if (sec % 60 == 0) {
min++; min++;
@ -114,9 +113,10 @@ public class RandomPkManager {
* 对方拒绝开始下一轮匹配 * 对方拒绝开始下一轮匹配
*/ */
private void nextPk() { private void nextPk() {
if (status != PK_STATUS_REQUEST && status != PK_STATUS_REFUSE) { if (status != PK_STATUS_DEFAULT && status != PK_STATUS_REFUSE) {
return; return;
} }
status = PK_STATUS_REQUEST;
LiveNetManager.get(CommonAppContext.getTopActivity()) LiveNetManager.get(CommonAppContext.getTopActivity())
.randomPK(new HttpCallback<String>() { .randomPK(new HttpCallback<String>() {
@Override @Override

View File

@ -219,6 +219,13 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
loadDialog = null; loadDialog = null;
if (data.getCode() == 0) { if (data.getCode() == 0) {
setSwitchBtn(!(boolean) mRandomPkSwitch.getTag()); setSwitchBtn(!(boolean) mRandomPkSwitch.getTag());
} else if (data.getCode() == 500) {
DialogUitl.showSimpleDialog(mContext, "您因拒绝随机PK被限制关闭中", "随机PK可打开时间" + data.getMsg(), false, new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
dialog.dismiss();
}
});
} else { } else {
ToastUtil.show(data.getMsg()); ToastUtil.show(data.getMsg());
} }

View File

@ -1200,10 +1200,9 @@ public class LiveRyLinkMicPkPresenter implements View.OnClickListener {
((TextView) context).setText("隨機PK可打開時間" + new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(System.currentTimeMillis() + 7200000)));//7200000ms=120m=2h ((TextView) context).setText("隨機PK可打開時間" + new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()).format(new Date(System.currentTimeMillis() + 7200000)));//7200000ms=120m=2h
((TextView) context).setTextSize(12); ((TextView) context).setTextSize(12);
((TextView) context).setTextColor(Color.parseColor("#999999")); ((TextView) context).setTextColor(Color.parseColor("#999999"));
refusePk(u);
cancelBtn.setVisibility(View.GONE); cancelBtn.setVisibility(View.GONE);
confirmBtn.setOnClickListener(v -> { confirmBtn.setOnClickListener(v -> {
refusePk(u);
dialog.dismiss(); dialog.dismiss();
}); });
} }