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