补充多人连麦文案

修复主播发起邀请时会在私聊里显示私聊im代码
This commit is contained in:
zlzw 2022-11-25 13:49:14 +08:00
parent 47b9487e13
commit b12547cd88
4 changed files with 36 additions and 14 deletions

View File

@ -249,17 +249,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
break;
case Constants.LIVE_FUNC_MIC://語音
//ToastUtil.show("開發中,敬請期待");
LiveMicAnchorDialogFragment fragment = new LiveMicAnchorDialogFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", "1");
fragment.setArguments(bundle);
micListener = fragment.getMicListener();
fragment.setMicQueueList(mMicQueueList);
fragment.setAudienceList(mAudienceList);
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveMicAnchorDialogFragment");
openMicWindow();
break;
case Constants.LIVE_FUNC_DR://多人PK
if (isDRPK != 1) {
@ -402,6 +392,19 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
}
private void openMicWindow() {
LiveMicAnchorDialogFragment fragment = new LiveMicAnchorDialogFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.STREAM, mStream);
bundle.putString("By", "1");
fragment.setArguments(bundle);
micListener = fragment.getMicListener();
fragment.setMicQueueList(mMicQueueList);
fragment.setAudienceList(mAudienceList);
fragment.show(((LiveRyAnchorActivity) mContext).getSupportFragmentManager(), "LiveMicAnchorDialogFragment");
}
/**
* 主播展示离开直播间
*/
@ -1327,6 +1330,16 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
}
if (micListener != null) {
micListener.updateMicList(mMicQueueList);
DialogUitl.showSimpleDialog(mContext,
String.format(WordUtil.getString(R.string.live_mic_user_apply), ((LinkMicUserBean) event.getObject()).getUname()),
new DialogUitl.SimpleCallback() {
@Override
public void onConfirmClick(Dialog dialog, String content) {
openMicWindow();
dialog.dismiss();
}
}
);
}
break;
case LINK_MIC_CANCEL:

View File

@ -28,6 +28,7 @@ import com.yunbao.common.http.ResponseModel;
import com.yunbao.common.utils.CommonIconUtil;
import com.yunbao.common.utils.SVGAViewUtils;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity;
@ -45,9 +46,11 @@ import java.net.URL;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.rong.imkit.IMCenter;
import io.rong.imlib.IRongCallback;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
import io.rong.imlib.model.Message;
import io.rong.message.TextMessage;
public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
@ -130,8 +133,8 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
SocketSendBean bean = createSocketSendBean().param("targetId", tag.getId());
applyMic(tag, 1, bean);
}
}else{
ToastUtil.show("仅允许三人与主播连麦");
} else {
ToastUtil.show(WordUtil.getString(R.string.live_mic_max));
}
}
});
@ -148,6 +151,7 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
@Override
public void accept(ResponseModel<BaseModel> stringResponseModel) throws Exception {
applyMic((MicUserBean) v.getTag(), 8, createSocketSendBean());
ToastUtil.show(WordUtil.getString(R.string.live_mic_user_down));
}
}, Throwable::printStackTrace).isDisposed();
@ -183,7 +187,8 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
public void onSuccess(io.rong.imlib.model.Message message) {
Log.e("ry", "发送成功");
refreshView.initData();
IMCenter.getInstance().deleteRemoteMessages(Conversation.ConversationType.PRIVATE, message.getTargetId(), new Message[]{message}, null);
IMCenter.getInstance().clearMessagesUnreadStatus(Conversation.ConversationType.PRIVATE, message.getTargetId(), null);
}
@Override

View File

@ -17,4 +17,5 @@
<string name="live_room_public_des">Available for all</string>
<string name="live_room_private_des">Only those who have the room code can watch</string>
<string name="live_room_type_submit">Submit</string>
<string name="live_mic_max">The number of voices has reached 3, and no more can be added.</string>
</resources>

View File

@ -27,4 +27,7 @@
<string name="more_than" translatable="false">已超过10秒未识别到录音</string>
<string name="live_role_title" translatable="false">身份特權</string>
<string name="noble_seat" translatable="false">貴族坐席</string>
<string name="live_mic_max">當前連麥語音人數已達到3人無法再添加。</string>
<string name="live_mic_user_apply" translatable="false">%s 申请连麦</string>
<string name="live_mic_user_down" translatable="false">已踢下麥</string>
</resources>