From 2aa50ecfc7477fb89026899003a777bc42956900 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Mon, 15 Jan 2024 16:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=96=87=E5=AD=97=E6=B6=88=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/SudGameSmallPopupPindow.java | 2 +- .../yunbao/live/activity/SudGameActivity.java | 59 +++++++++---------- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/dialog/SudGameSmallPopupPindow.java b/common/src/main/java/com/yunbao/common/dialog/SudGameSmallPopupPindow.java index 5c2d527d8..e7bec0482 100644 --- a/common/src/main/java/com/yunbao/common/dialog/SudGameSmallPopupPindow.java +++ b/common/src/main/java/com/yunbao/common/dialog/SudGameSmallPopupPindow.java @@ -48,7 +48,7 @@ public class SudGameSmallPopupPindow extends AttachPopupView { return; } if (sudGameUserModel.getMicStatus() == 3) { - ToastUtil.show("对方未开麦!"); + ToastUtil.show(WordUtil.isNewZh() ? "對方未開麥!" : "The other side did not turn on the microphone"); return; } if (!mute) { diff --git a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java index f190a21a1..c9093b892 100644 --- a/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/SudGameActivity.java @@ -126,20 +126,7 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat); gameCloseWheat.setVisibility(View.INVISIBLE); - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - if (!mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) { - ToastUtil.show("拒绝权限将无法使用上麦功能"); - mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() { - @Override - public void run() { - } - }); - } - } - }, 1500); mProcessResultUtil = new ProcessResultUtil(this); LiveNetManager.get(mContext) .getRoomMicStatus(new HttpCallback() { @@ -151,13 +138,24 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti //语音 if (TextUtils.equals(data.getMicStatus(), "1")) { imOff = true; - - gameCloseWheat.setVisibility(View.VISIBLE); gameSeat.setVisibility(View.VISIBLE); userList.setVisibility(View.VISIBLE); + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + if (!mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) { + ToastUtil.show("拒绝权限将无法使用上麦功能"); + mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() { + @Override + public void run() { + + } + }); + } + } + }, 1500); } else { imOff = false; - gameCloseWheat.setVisibility(View.GONE); gameSeat.setVisibility(View.GONE); userList.setVisibility(View.GONE); } @@ -189,25 +187,24 @@ public class SudGameActivity extends AbsActivity implements GameMicManager.Meeti @Override protected void onDestroy() { + + LiveNetManager.get(mContext) + .leaveMic(mLiveUid, new HttpCallback() { + @Override + public void onSuccess(HttpCallbackModel data) { + + } + + @Override + public void onError(String error) { + + } + }); + if (gameMicManager != null) { gameMicManager.leaveRoom(); gameMicManager.detachView(); } - if (imOff) { - LiveNetManager.get(mContext) - .leaveMic(mLiveUid, new HttpCallback() { - @Override - public void onSuccess(HttpCallbackModel data) { - - } - - @Override - public void onError(String error) { - - } - }); - } - Bus.getOff(this); super.onDestroy();