RongIMClient.setTypingStatusListener((type, targetId, typingStatusSet) -> { if (type.equals(mConversationType) && targetId.equals(mSessionId)) {
case R.id.group_announcement: Intent tempIntent = new Intent(mContext, GroupNoticeActivity.class); tempIntent.putExtra("conversationType", Conversation.ConversationType.GROUP.getValue()); tempIntent.putExtra("targetId", fromConversationId); startActivity(tempIntent);
bottomButtonContainer.setVisibility(View.VISIBLE); } else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) { Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.US)); String targetId = intent.getStringExtra("targetId"); ArrayList<String> userIds = intent.getStringArrayListExtra("invitedUsers");
mMediaType = RongCallCommon.CallMediaType.valueOf(type); int conType = intent.getIntExtra("conversationType", 0); conversationType = Conversation.ConversationType.setValue(conType); invitedMembers = intent.getStringArrayListExtra("invitedMembers"); allObserver=intent.getStringArrayListExtra("allObserver");
return; mConversationType = Conversation.ConversationType.valueOf(intent.getData() .getLastPathSegment().toUpperCase(Locale.US)); if (mConversationType.equals(Conversation.ConversationType.GROUP)) { mRightButton.setBackground(getResources().getDrawable(R.drawable.icon2_menu)); } else if (mConversationType.equals(Conversation.ConversationType.PRIVATE) || mConversationType.equals(Conversation.ConversationType.PUBLIC_SERVICE) || mConversationType.equals(Conversation.ConversationType.APP_PUBLIC_SERVICE) || mConversationType.equals(Conversation.ConversationType.DISCUSSION)) { mRightButton.setBackground(getResources().getDrawable(R.drawable.icon1_menu)); } else { if (mConversationType.equals(Conversation.ConversationType.CUSTOMER_SERVICE)) { setAnnounceListener();
Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.US)); String targetId = intent.getStringExtra("targetId"); ArrayList<String> userIds = intent.getStringArrayListExtra("invitedUsers");
if (conversationType.equals(Conversation.ConversationType.PRIVATE)) { Intent intent = new Intent(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO); intent.putExtra("conversationType", conversationType.getName().toLowerCase()); Log.i(TAG,"---- conversationType.getName().toLowerCase() =-"+conversationType.getName().toLowerCase()); intent.putExtra("targetId", targetId); intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName()); intent.setPackage(context.getPackageName()); context.getApplicationContext().startActivity(intent); } else if (conversationType.equals(Conversation.ConversationType.DISCUSSION)) { RongIM.getInstance().getDiscussion(targetId, new RongIMClient.ResultCallback<Discussion>() { @Override } else if (conversationType.equals(Conversation.ConversationType.GROUP)) { Intent intent = new Intent(context, CallSelectMemberActivity.class); String myId = RongIMClient.getInstance().getCurrentUserId(); invited.add(myId); intent.putStringArrayListExtra("invitedMembers", invited); intent.putExtra("conversationType", conversationType.getValue()); intent.putExtra("groupId", targetId); intent.putExtra("mediaType", RongCallCommon.CallMediaType.AUDIO.getValue());
FinLog.d("VoIPReceiver", "startVoIPActivity"); String action; if (callSession.getConversationType().equals(Conversation.ConversationType.DISCUSSION) || callSession.getConversationType().equals(Conversation.ConversationType.GROUP) || callSession.getConversationType().equals(Conversation.ConversationType.NONE)) { if (callSession.getMediaType().equals(RongCallCommon.CallMediaType.VIDEO)) { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIVIDEO;
return; if (conversationType.equals(Conversation.ConversationType.PRIVATE)) { Intent intent = new Intent(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEVIDEO); intent.putExtra("conversationType", conversationType.getName().toLowerCase(Locale.US)); intent.putExtra("targetId", targetId); intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName()); intent.setPackage(context.getPackageName()); context.getApplicationContext().startActivity(intent); } else if (conversationType.equals(Conversation.ConversationType.DISCUSSION)) { RongIM.getInstance().getDiscussion(targetId, new RongIMClient.ResultCallback<Discussion>() { @Override } else if (conversationType.equals(Conversation.ConversationType.GROUP)) { Intent intent = new Intent(context, CallSelectMemberActivity.class); String myId = RongIMClient.getInstance().getCurrentUserId(); intent.putStringArrayListExtra("invitedMembers", invited); intent.putExtra("groupId", targetId); intent.putExtra("conversationType", conversationType.getValue()); intent.putExtra("mediaType", RongCallCommon.CallMediaType.VIDEO.getValue()); extension.startActivityForPluginResult(intent, 110, this);
&& (normalTime - message.getSentTime()) <= messageRecallInterval * 1000 && message.getSenderUserId().equals(RongIM.getInstance().getCurrentUserId()) && !message.getConversationType().equals(Conversation.ConversationType.CUSTOMER_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.APP_PUBLIC_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.PUBLIC_SERVICE) && !message.getConversationType().equals(Conversation.ConversationType.SYSTEM) && !message.getConversationType().equals(Conversation.ConversationType.CHATROOM)) { items = new String[] {view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_copy), view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_delete), view.getContext().getResources().getString(io.rong.imkit.R.string.rc_dialog_item_message_recall)}; } else {
if (conversationType != null && conversationType.equals(Conversation.ConversationType.GROUP)) { GroupUserInfo groupUserInfo = RongUserInfoManager.getInstance().getGroupUserInfo(groupId, mallMembers.get(position)); if (groupUserInfo != null && !TextUtils.isEmpty(groupUserInfo.getNickname())) {
mediaType = RongCallCommon.CallMediaType.VIDEO; Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.US)); targetId = intent.getStringExtra("targetId");
@Override public void onClick(View v) { setShouldShowFloat(false); if (callSession.getConversationType().equals(Conversation.ConversationType.DISCUSSION)) { RongIMClient.getInstance().getDiscussion(callSession.getTargetId(), new RongIMClient.ResultCallback<Discussion>() { @Override } else if (callSession.getConversationType().equals(Conversation.ConversationType.GROUP)) { Intent intent = new Intent(MultiAudioCallActivity.this, CallSelectMemberActivity.class); ArrayList<String> added = new ArrayList<>(); intent.putStringArrayListExtra("allObserver",allObserver); intent.putStringArrayListExtra("invitedMembers", added); intent.putExtra("conversationType", callSession.getConversationType().getValue()); intent.putExtra("groupId", callSession.getTargetId()); intent.putExtra("mediaType", RongCallCommon.CallMediaType.AUDIO.getValue());
uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon() .appendPath("conversationlist") .appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "true") //设置私聊会话是否聚合显示 .appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "true")//群组 .appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号 .appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号 .appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统 .appendQueryParameter(Conversation.ConversationType.DISCUSSION.getName(), "true") .build(); mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE, uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon() .appendPath("conversationlist") .appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false") //设置私聊会话是否聚合显示 .appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")//群组 .appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")//公共服务号 .appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")//订阅号 .appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")//系统 .build(); mConversationsTypes = new Conversation.ConversationType[]{Conversation.ConversationType.PRIVATE,
private void addButtionClickEvent() { setShouldShowFloat(false); if (callSession.getConversationType().equals(Conversation.ConversationType.DISCUSSION)) { RongIMClient.getInstance().getDiscussion(callSession.getTargetId(), new RongIMClient.ResultCallback<Discussion>() { @Override } else if (callSession.getConversationType().equals(Conversation.ConversationType.GROUP)) { Intent intent = new Intent(MultiVideoCallActivity.this, CallSelectMemberActivity.class); ArrayList<String> added = new ArrayList<>(); intent.putStringArrayListExtra("invitedMembers", added); intent.putExtra("groupId", callSession.getTargetId()); intent.putExtra("conversationType", callSession.getConversationType().getValue()); intent.putExtra("mediaType", RongCallCommon.CallMediaType.VIDEO.getValue()); startActivityForResult(intent, REQUEST_CODE_ADD_MEMBER);
@Override public List<IPluginModule> getPluginModules(Conversation.ConversationType conversationType) { if (conversationType.equals(Conversation.ConversationType.PUBLIC_SERVICE)) { List<IPluginModule> pluginModuleList = new ArrayList<>(); IPluginModule image = new ImagePlugin();
@Override public void onItemClick(View view, int position, CallSTerminateMessage content, UIMessage message) { if (content.getReason() == OTHER_DEVICE_HAD_ACCEPTED){ return; } RongCallSession profile = RongCallClient.getInstance().getCallSession(); if (profile != null && profile.getActiveTime() > 0) { Toast.makeText(view.getContext(), profile.getMediaType() == RongCallCommon.CallMediaType.AUDIO ? view.getContext().getString(R.string.rc_voip_call_audio_start_fail) : view.getContext().getString(R.string.rc_voip_call_video_start_fail), Toast.LENGTH_SHORT) .show(); return; } RongCallCommon.CallMediaType mediaType = content.getMediaType(); String action = null; if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEVIDEO; } else { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO; } Intent intent = new Intent(action); intent.setPackage(view.getContext().getPackageName()); intent.putExtra("conversationType", message.getConversationType().getName().toLowerCase(Locale.US)); intent.putExtra("targetId", message.getTargetId()); intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName()); view.getContext().startActivity(intent); }
@Override public void onGotMemberList(ArrayList<String> members) { if (mAdapter != null) { if (members != null && members.size() > 0) { mAdapter.setAllMembers(members); allMembers=members; mAdapter.notifyDataSetChanged(); /**转换昵称***/ for (int i = 0; i < allMembers.size(); i++) { String userNickName=allMembers.get(i); userInfo = RongContext.getInstance().getUserInfoFromCache(userNickName); String displayName = ""; if (conversationType != null && conversationType.equals(Conversation.ConversationType.GROUP)) { groupUserInfo = RongUserInfoManager.getInstance().getGroupUserInfo(groupId, userNickName); if (groupUserInfo != null && !TextUtils.isEmpty(groupUserInfo.getNickname())) { displayName = groupUserInfo.getNickname(); userNickName=displayName; } } if (TextUtils.isEmpty(displayName)) { if (userInfo != null) { userNickName=userInfo.getName(); } } tempNickmembers.put(allMembers.get(i),userNickName); } } } } });
/** * 设置会话页面 Title * * @param conversationType 会话类型 * @param targetId 目标 Id */ private void setActionBarTitle(Conversation.ConversationType conversationType, String targetId) { if (conversationType == null) return; if (conversationType.equals(Conversation.ConversationType.PRIVATE)) { setPrivateActionBar(targetId); } else if (conversationType.equals(Conversation.ConversationType.GROUP)) { setGroupActionBar(targetId); } else if (conversationType.equals(Conversation.ConversationType.DISCUSSION)) { setDiscussionActionBar(targetId); } else if (conversationType.equals(Conversation.ConversationType.CHATROOM)) { setTitle(title); } else if (conversationType.equals(Conversation.ConversationType.SYSTEM)) { setTitle(R.string.de_actionbar_system); } else if (conversationType.equals(Conversation.ConversationType.APP_PUBLIC_SERVICE)) { setAppPublicServiceActionBar(targetId); } else if (conversationType.equals(Conversation.ConversationType.PUBLIC_SERVICE)) { setPublicServiceActionBar(targetId); } else if (conversationType.equals(Conversation.ConversationType.CUSTOMER_SERVICE)) { setTitle(R.string.main_customer); } else { setTitle(R.string.de_actionbar_sub_defult); } }
/** * 发起多人通话 * * @param context 上下文 * @param conversationType 会话类型 * @param targetId 会话 id * @param mediaType 会话媒体类型 * @param userIds 参与者 id 列表 */ public static void startMultiCall(Context context, Conversation.ConversationType conversationType, String targetId, CallMediaType mediaType, ArrayList<String> userIds) { if (checkEnvironment(context, mediaType)) { String action; if (mediaType.equals(CallMediaType.CALL_MEDIA_TYPE_AUDIO)) { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIAUDIO; } else { action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIVIDEO; } Intent intent = new Intent(action); userIds.add(RongIMClient.getInstance().getCurrentUserId()); intent.putExtra("conversationType", conversationType.getName().toLowerCase()); intent.putExtra("targetId", targetId); intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName()); intent.setPackage(context.getPackageName()); intent.putStringArrayListExtra("invitedUsers", userIds); context.startActivity(intent); } }