From 5e9f23286e1e6c5d44a472c433cc1ff07777d5fd Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Fri, 9 Dec 2022 10:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9A=8F=E6=9C=BAPK=E5=89=8D?= =?UTF-8?q?=E5=85=88=E6=A3=80=E6=B5=8B=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E4=BA=86=E8=BF=9E=E9=BA=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/dialog/RandomPkDialogFragment.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java index 032f61be7..3925c7375 100644 --- a/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/RandomPkDialogFragment.java @@ -15,12 +15,18 @@ import androidx.annotation.Nullable; import com.yunbao.common.bean.HttpCallbackModel; import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.DialogUitl; +import com.yunbao.common.utils.MicStatusManager; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.common.manager.RandomPkManager; +import com.yunbao.live.activity.LiveRyAnchorActivity; +import com.yunbao.live.http.LiveHttpUtil; + +import java.util.Arrays; /** * 随机PK @@ -237,12 +243,23 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On RandomPkManager.getInstance().exitPk(); return; } + LiveHttpUtil.getMicList(LiveRyAnchorActivity.mLiveUid, 0, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + System.out.println("code = " + code + ", msg = " + msg + ", info = " + Arrays.deepToString(info)); + //非0认为未开通连麦权限 + if (code != 0) { + if (RandomPkManager.getInstance().start()) { + mPkBtnDesc.setVisibility(View.VISIBLE); + mPkBtnDesc.setText(R.string.random_pk_info_btn_ing_desc); + mPkBtn.setTag(true); + } + } else { + ToastUtil.show("請先關閉語言連麥"); + } + } + }); - if (RandomPkManager.getInstance().start()) { - mPkBtnDesc.setVisibility(View.VISIBLE); - mPkBtnDesc.setText(R.string.random_pk_info_btn_ing_desc); - mPkBtn.setTag(true); - } } private void resetPkBtn() {