From 62c3cdcb300a161aa586a1b2177369e15158800c Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Sat, 10 Dec 2022 14:59:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E9=9A=8F=E6=9C=BAPK=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=AF=B9=E6=96=B9=E4=B8=BB=E6=92=AD=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?PK=E6=97=B6=E4=B8=8D=E4=BC=9A=E7=BB=A7=E7=BB=AD=E8=B0=83?= =?UTF-8?q?=E7=94=A8next=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/live/adapter/FreePkRecyclerAdapter.java | 9 +++++++++ .../com/yunbao/live/dialog/FreePkDialogFragment.java | 2 ++ .../src/main/res/layout/dialog_live_free_pk_function.xml | 4 ++-- live/src/main/res/values/strings.xml | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java index 9b0b19aa6..e520f6c9c 100644 --- a/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/FreePkRecyclerAdapter.java @@ -27,6 +27,11 @@ import java.util.Arrays; public class FreePkRecyclerAdapter extends RefreshAdapter { private static final int HEAD = 0; private static final int ITEM = 2; + private int freePkNum;//PK次数 + + public void setFreePkNum(int freePkNum) { + this.freePkNum = freePkNum; + } public FreePkRecyclerAdapter(Context context) { super(context); @@ -101,6 +106,10 @@ public class FreePkRecyclerAdapter extends RefreshAdapter { ToastUtil.show(R.string.free_pk_user_pking); return; } + if (freePkNum == 0) { + ToastUtil.show(R.string.free_pk_num_null); + return; + } LiveHttpUtil.getMicList(LiveRyAnchorActivity.mLiveUid, 0, new com.yunbao.common.http.HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { diff --git a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java index 3b75255e0..bcf1f15d2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/FreePkDialogFragment.java @@ -151,6 +151,7 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl @Override public void onSuccess(Integer data) { freePkNum.setText("" + data); + adapter.setFreePkNum(data); } @Override @@ -238,6 +239,7 @@ public class FreePkDialogFragment extends AbsDialogFragment implements View.OnCl /** * 搜索 + * * @param key */ public void search(String key) { diff --git a/live/src/main/res/layout/dialog_live_free_pk_function.xml b/live/src/main/res/layout/dialog_live_free_pk_function.xml index 11421eed6..1a46603f2 100644 --- a/live/src/main/res/layout/dialog_live_free_pk_function.xml +++ b/live/src/main/res/layout/dialog_live_free_pk_function.xml @@ -155,8 +155,8 @@ 退出過程中也有可能匹配到對手 請輸入您要pk的主播昵稱或id 對方正在PK中 + PK次數已用完