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