io.rong.imlib.model.UserInfo Java Examples
The following examples show how to use
io.rong.imlib.model.UserInfo.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MeFragment.java From LQRWeChat with MIT License | 6 votes |
private void showQRCard() { if (mQrCardDialog == null) { View qrCardView = View.inflate(getActivity(), R.layout.include_qrcode_card, null); ImageView ivHeader = (ImageView) qrCardView.findViewById(R.id.ivHeader); TextView tvName = (TextView) qrCardView.findViewById(R.id.tvName); ImageView ivCard = (ImageView) qrCardView.findViewById(R.id.ivCard); TextView tvTip = (TextView) qrCardView.findViewById(R.id.tvTip); tvTip.setText(UIUtils.getString(R.string.qr_code_card_tip)); UserInfo userInfo = mPresenter.getUserInfo(); if (userInfo != null) { Glide.with(getActivity()).load(userInfo.getPortraitUri()).centerCrop().into(ivHeader); tvName.setText(userInfo.getName()); Observable.just(QRCodeEncoder.syncEncodeQRCode(AppConst.QrCodeCommon.ADD + userInfo.getUserId(), UIUtils.dip2Px(100))) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(bitmap -> ivCard.setImageBitmap(bitmap), this::loadQRCardError); } mQrCardDialog = new CustomDialog(getActivity(), 300, 400, qrCardView, R.style.MyDialog); } mQrCardDialog.show(); }
Example #2
Source File: NewTextMessageActivity.java From sealtalk-android with MIT License | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_reply); getSupportActionBar().setTitle("选择回复的人"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R.drawable.de_actionbar_back); mReplyListView = (ListView) findViewById(R.id.de_reply); mNumberlist = new ArrayList(); mUserInfoList = new ArrayList<UserInfo>(); initDate(); }
Example #3
Source File: CallUserGridView.java From sealtalk-android with MIT License | 6 votes |
public void updateChildInfo(String childId, UserInfo userInfo) { int containerCount = linearLayout.getChildCount(); LinearLayout lastContainer = null; for(int i = 0; i < containerCount; i++) { LinearLayout container = (LinearLayout) linearLayout.getChildAt(i); LinearLayout child = (LinearLayout) container.findViewWithTag(childId); if(child != null) { AsyncImageView imageView = (AsyncImageView)child.getChildAt(0); imageView.setAvatar(userInfo.getPortraitUri()); if(enableTitle) { TextView textView = (TextView)child.getChildAt(1); textView.setText(userInfo.getName()); } } } }
Example #4
Source File: RealTimeLocationActivity.java From sealtalk-android with MIT License | 6 votes |
private UserInfo getCacheUserInfoById(String userId) { UserInfo info = RongContext.getInstance().getUserInfoFromCache(userId); if (info != null) { return info; } else { if (list != null && list.size() > 0) { for (Friend f : list) { if (userId.equals(f.getUserId())) { return new UserInfo(f.getUserId(), f.getName(), Uri.parse(f.getPortraitUri())); } } } } String id = sp.getString("loginid", ""); if (!TextUtils.isEmpty(id) && id.equals(userId)) { return new UserInfo(id, sp.getString("loginnickname", ""), Uri.parse(sp.getString("loginPortrait", ""))); } return null; }
Example #5
Source File: MultiVideoCallActivity.java From sealtalk-android with MIT License | 6 votes |
View addSingleRemoteView(String userId) { View singleRemoteView = inflater.inflate(R.layout.rc_voip_viewlet_remote_user, null); UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(userId); singleRemoteView.setTag(userId + "view"); AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait); if (userInfo != null) { if (userInfo.getPortraitUri() != null) { userPortraitView.setAvatar(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait); } } LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(remoteUserViewWidth, remoteUserViewWidth); params.setMargins(0, 0, 10, 0); if (remoteViewContainer2.getChildCount() < 4) { remoteViewContainer2.addView(singleRemoteView, params); } else if (remoteViewContainer1.getChildCount() < 4){ remoteViewContainer1.addView(singleRemoteView, params); } return singleRemoteView; }
Example #6
Source File: DBManager.java From LQRWeChat with MIT License | 6 votes |
/** * app中获取用户头像的接口 * 这个方法不涉及读数据库,头像空时直接生成默认头像 */ public String getPortraitUri(UserInfo userInfo) { if (userInfo != null) { if (userInfo.getPortraitUri() != null) { if (TextUtils.isEmpty(userInfo.getPortraitUri().toString())) { if (userInfo.getName() != null) { return RongGenerate.generateDefaultAvatar(userInfo); } else { return null; } } else { return userInfo.getPortraitUri().toString(); } } else { if (userInfo.getName() != null) { return RongGenerate.generateDefaultAvatar(userInfo); } else { return null; } } } return null; }
Example #7
Source File: SessionActivity.java From LQRWeChat with MIT License | 5 votes |
private void setTitle() { if (mConversationType == Conversation.ConversationType.PRIVATE) { UserInfo userInfo = DBManager.getInstance().getUserInfo(mSessionId); if (userInfo != null) setToolbarTitle(userInfo.getName()); } else if (mConversationType == Conversation.ConversationType.GROUP) { Groups groups = DBManager.getInstance().getGroupsById(mSessionId); if (groups != null) setToolbarTitle(groups.getName()); } }
Example #8
Source File: RedPacketMessage.java From LQRWeChat with MIT License | 5 votes |
public RedPacketMessage(Parcel var1) { this.setBribery_ID(ParcelUtils.readFromParcel(var1)); this.setBribery_Name(ParcelUtils.readFromParcel(var1)); this.setBribery_Message(ParcelUtils.readFromParcel(var1)); this.setContent(ParcelUtils.readFromParcel(var1)); this.setUserInfo((UserInfo) ParcelUtils.readFromParcel(var1, UserInfo.class)); }
Example #9
Source File: UserInfoEngine.java From sealtalk-android with MIT License | 5 votes |
@Override public void onSuccess(int requestCode, Object result) { if (result != null) { GetUserInfoByIdResponse res = (GetUserInfoByIdResponse) result; if (res.getCode() == 200) { userInfo = new UserInfo(res.getResult().getId(), res.getResult().getNickname(), Uri.parse(res.getResult().getPortraitUri())); if (mListener != null) { mListener.onResult(userInfo); } } } }
Example #10
Source File: CallSelectMemberActivity.java From sealtalk-android with MIT License | 5 votes |
@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = LayoutInflater.from(CallSelectMemberActivity.this).inflate(R.layout.rc_voip_listitem_select_member, null); holder.checkbox = (ImageView) convertView.findViewById(R.id.rc_checkbox); holder.portrait = (AsyncImageView) convertView.findViewById(R.id.rc_user_portrait); holder.name = (TextView) convertView.findViewById(R.id.rc_user_name); convertView.setTag(holder); } holder = (ViewHolder)convertView.getTag(); holder.checkbox.setTag(allMembers.get(position)); if(invitedMembers.contains(allMembers.get(position))) { holder.checkbox.setClickable(false); holder.checkbox.setEnabled(false); holder.checkbox.setImageResource(R.drawable.rc_voip_icon_checkbox_checked); } else { if(selectedMember.contains(allMembers.get(position))) { holder.checkbox.setImageResource(R.drawable.rc_voip_checkbox); holder.checkbox.setSelected(true); } else { holder.checkbox.setImageResource(R.drawable.rc_voip_checkbox); holder.checkbox.setSelected(false); } holder.checkbox.setClickable(true); holder.checkbox.setEnabled(true); } UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(allMembers.get(position)); if (userInfo != null) { holder.name.setText(userInfo.getName()); holder.portrait.setAvatar(userInfo.getPortraitUri()); } else { holder.name.setText(allMembers.get(position)); holder.portrait.setAvatar(null); } return convertView; }
Example #11
Source File: DiscussionDetailActivity.java From sealtalk-android with MIT License | 5 votes |
@Override public void onSuccess(int requestCode, Object result) { switch (requestCode) { case FINDUSERINFO: GetUserInfosResponse response = (GetUserInfosResponse) result; if (response.getCode() == 200) { List<GetUserInfosResponse.ResultEntity> infos = response.getResult(); memberList.clear(); for (GetUserInfosResponse.ResultEntity g : infos) { memberList.add(new UserInfo(g.getId(),g.getNickname(), Uri.parse(g.getPortraitUri()))); } String loginid = getSharedPreferences("config", MODE_PRIVATE).getString("loginid", ""); if (loginid.equals(createId)) { isCreated = true; } if (memberList != null && memberList.size() > 1) { if(adapter == null) { adapter = new GridAdapter(mContext, memberList); gridview.setAdapter(adapter); } else { adapter.updateListView(memberList); } } LoadDialog.dismiss(mContext); } break; } }
Example #12
Source File: SingleCallActivity.java From sealtalk-android with MIT License | 5 votes |
private void initAudioCallView() { mLPreviewContainer.removeAllViews(); mLPreviewContainer.setVisibility(View.GONE); mSPreviewContainer.removeAllViews(); mSPreviewContainer.setVisibility(View.GONE); findViewById(R.id.rc_voip_call_information).setBackgroundColor(getResources().getColor(R.color.rc_voip_background_color)); findViewById(R.id.rc_voip_audio_chat).setVisibility(View.GONE); View userInfoView = inflater.inflate(R.layout.rc_voip_audio_call_user_info, null); TextView timeView = (TextView) userInfoView.findViewById(R.id.rc_voip_call_remind_info); setupTime(timeView); mUserInfoContainer.removeAllViews(); mUserInfoContainer.addView(userInfoView); UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(targetId); if (userInfo != null) { TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name); userName.setText(userInfo.getName()); if (callSession.getMediaType().equals(RongCallCommon.CallMediaType.AUDIO)) { AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait); if (userPortrait != null) { userPortrait.setAvatar(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait); } } } mUserInfoContainer.setVisibility(View.VISIBLE); mUserInfoContainer.findViewById(R.id.rc_voip_call_minimize).setVisibility(View.VISIBLE); View button = inflater.inflate(R.layout.rc_voip_call_bottom_connected_button_layout, null); mButtonContainer.removeAllViews(); mButtonContainer.addView(button); mButtonContainer.setVisibility(View.VISIBLE); View handFreeV = mButtonContainer.findViewById(R.id.rc_voip_handfree); handFreeV.setSelected(handFree); }
Example #13
Source File: ContactNotificationMessageProvider.java From sealtalk-android with MIT License | 5 votes |
@Override public void onItemLongClick(View view, int position, ContactNotificationMessage content, final UIMessage message) { String name = null; if (message.getConversationType().getName().equals(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName()) || message.getConversationType().getName().equals(Conversation.ConversationType.PUBLIC_SERVICE.getName())) { Conversation.PublicServiceType publicServiceType = Conversation.PublicServiceType.setValue(message.getConversationType().getValue()); PublicServiceProfile info = RongUserInfoManager.getInstance().getPublicServiceProfile(publicServiceType, message.getTargetId()); if (info != null) name = info.getName(); } else { UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(message.getSenderUserId()); if (userInfo != null) name = userInfo.getName(); } String[] items; items = new String[]{view.getContext().getResources().getString(R.string.de_dialog_item_message_delete)}; ArraysDialogFragment.newInstance(name, items).setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() { @Override public void OnArraysDialogItemClick(DialogInterface dialog, int which) { if (which == 0) RongIM.getInstance().getRongIMClient().deleteMessages(new int[]{message.getMessageId()}, null); } }).show(((FragmentActivity) view.getContext()).getSupportFragmentManager()); }
Example #14
Source File: RealTimeLocationMessageProvider.java From sealtalk-android with MIT License | 5 votes |
@Override public void onItemLongClick(final View view, int position, final RealTimeLocationStartMessage content, final UIMessage message) { ViewHolder holder = (ViewHolder) view.getTag(); holder.longClick = true; if (view instanceof TextView) { CharSequence text = ((TextView) view).getText(); if (text != null && text instanceof Spannable) Selection.removeSelection((Spannable) text); } String name = null; if (message.getSenderUserId() != null) { UserInfo userInfo = RongUserInfoManager.getInstance().getUserInfo(message.getSenderUserId()); if (userInfo != null) name = userInfo.getName(); } String[] items; Resources res = view.getContext().getResources(); items = new String[]{res.getString(R.string.rc_dialog_item_message_delete)}; ArraysDialogFragment.newInstance(name, items).setArraysDialogItemListener(new ArraysDialogFragment.OnArraysDialogItemListener() { @Override public void OnArraysDialogItemClick(DialogInterface dialog, int which) { if (which == 0) { RongIM.getInstance().getRongIMClient().deleteMessages(new int[]{message.getMessageId()}, null); } } }).show(((FragmentActivity) view.getContext()).getSupportFragmentManager()); }
Example #15
Source File: MultiVideoCallActivity.java From sealtalk-android with MIT License | 5 votes |
@Override public void onRemoteUserLeft(String userId, RongCallCommon.CallDisconnectedReason reason) { //incoming状态,localViewUserId为空 if (localViewUserId == null) return; if (localViewUserId.equals(userId)) { localViewContainer.removeAllViews(); String currentUserId = RongIMClient.getInstance().getCurrentUserId(); FrameLayout remoteVideoView = (FrameLayout) remoteViewContainer.findViewWithTag(currentUserId); localView = (SurfaceView) remoteVideoView.getChildAt(0); remoteVideoView.removeAllViews(); localViewContainer.addView(localView); TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name); UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(currentUserId); if (userInfo != null) { topUserNameView.setText(userInfo.getName()); } else { topUserNameView.setText(currentUserId); } localViewUserId = currentUserId; } View singleRemoteView = remoteViewContainer.findViewWithTag(userId + "view"); if (singleRemoteView == null) return; LinearLayout container = (LinearLayout) singleRemoteView.getParent(); container.removeView(singleRemoteView); if (container.equals(remoteViewContainer2)) { if (remoteViewContainer1.getChildCount() > 0) { View childView = remoteViewContainer1.getChildAt(0); remoteViewContainer1.removeView(childView); remoteViewContainer2.addView(childView); } } }
Example #16
Source File: RedPacketUtil.java From LQRWeChat with MIT License | 5 votes |
/** * 模拟获取当前用户信息的方法 * * @return RedPacketInfo */ public static RedPacketInfo getCurrentUserInfo() { RedPacketInfo redPacketInfo = new RedPacketInfo(); UserInfo userInfo = DBManager.getInstance().getUserInfo(UserCache.getId()); //红包发送者昵称 不可为空 redPacketInfo.fromNickName = userInfo != null ? userInfo.getName() : "CSDN_LQR"; //红包发送者头像url 不可为空 redPacketInfo.fromAvatarUrl = userInfo != null ? userInfo.getPortraitUri().toString() : "http://avatar.csdn.net/6/6/F/1_csdn_lqr.jpg"; return redPacketInfo; }
Example #17
Source File: RealTimeLocationActivity.java From sealtalk-android with MIT License | 5 votes |
private void addUserInfoToScrollView(final String userId) { UserInfo userInfo = getCacheUserInfoById(userId); if (userInfo != null) { if (TextUtils.isEmpty(userInfo.getPortraitUri().toString())) { userInfo.setPortraitUri(Uri.parse(RongGenerate.generateDefaultAvatar(userInfo.getName(), userInfo.getUserId()))); } horizontalScrollView.addUserToView(userInfo); setParticipantTextView(-1); } else { UserInfoEngine.getInstance(this).startEngine(userId); } }
Example #18
Source File: ChangeMyNameActivity.java From LQRWeChat with MIT License | 5 votes |
@Override public void initView() { mBtnToolbarSend.setText(UIUtils.getString(R.string.save)); mBtnToolbarSend.setVisibility(View.VISIBLE); UserInfo userInfo = DBManager.getInstance().getUserInfo(UserCache.getId()); if (userInfo != null) mEtName.setText(userInfo.getName()); mEtName.setSelection(mEtName.getText().toString().trim().length()); }
Example #19
Source File: NewFriendListActivity.java From sealtalk-android with MIT License | 5 votes |
/** * 添加好友成功后,向对方发送一条消息 * * @param id 对方id */ private void sendMessage(String id) { final AgreedFriendRequestMessage message = new AgreedFriendRequestMessage(id, "agree"); //获取当前用户的 userid String userid = sp.getString("loginid", ""); String username = sp.getString("loginnickname", ""); String userportrait = sp.getString("loginPortrait", ""); UserInfo userInfo = new UserInfo(userid, username, Uri.parse(userportrait)); //把用户信息设置到消息体中,直接发送给对方,可以不设置,非必选项 message.setUserInfo(userInfo); //发送一条添加成功的自定义消息,此条消息不会在ui上展示 RongIM.getInstance().sendMessage(Conversation.ConversationType.PRIVATE, id, message, null, null, new RongIMClient.SendMessageCallback() { @Override public void onError(Integer messageId, RongIMClient.ErrorCode e) { Log.e(TAG, Constants.DEBUG + "------DeAgreedFriendRequestMessage----onError--"); } @Override public void onSuccess(Integer integer) { Log.e(TAG, Constants.DEBUG + "------DeAgreedFriendRequestMessage----onSuccess--" + message.getMessage()); } }); }
Example #20
Source File: MeFgPresenter.java From LQRWeChat with MIT License | 5 votes |
public void refreshUserInfo() { UserInfo userInfo = DBManager.getInstance().getUserInfo(UserCache.getId()); if (userInfo == null) { loadUserInfo(); } else { mUserInfo = userInfo; } }
Example #21
Source File: SessionInfoAtPresenter.java From LQRWeChat with MIT License | 5 votes |
public void addGroupMember(ArrayList<String> selectedIds) { LogUtils.sf("addGroupMember : " + selectedIds); mContext.showWaitingDialog(UIUtils.getString(R.string.please_wait)); ApiRetrofit.getInstance().addGroupMember(mSessionId, selectedIds) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(addGroupMemberResponse -> { if (addGroupMemberResponse != null && addGroupMemberResponse.getCode() == 200) { LogUtils.sf("网络请求成功,开始添加群成员:"); Groups groups = DBManager.getInstance().getGroupsById(mSessionId); for (String groupMemberId : selectedIds) { UserInfo userInfo = DBManager.getInstance().getUserInfo(groupMemberId); if (userInfo != null) { GroupMember newMember = new GroupMember(mSessionId, userInfo.getUserId(), userInfo.getName(), userInfo.getPortraitUri().toString(), userInfo.getName(), PinyinUtils.getPinyin(userInfo.getName()), PinyinUtils.getPinyin(userInfo.getName()), groups.getName(), PinyinUtils.getPinyin(groups.getName()), groups.getPortraitUri()); DBManager.getInstance().saveOrUpdateGroupMember(newMember); LogUtils.sf("添加群成员成功"); } } LogUtils.sf("添加群成员结束"); mContext.hideWaitingDialog(); loadData(); LogUtils.sf("重新加载数据"); UIUtils.showToast(UIUtils.getString(R.string.add_member_success)); } }, this::addMembersError); }
Example #22
Source File: SessionInfoAtPresenter.java From LQRWeChat with MIT License | 5 votes |
private void loadData() { if (mConversationType == Conversation.ConversationType.PRIVATE) { UserInfo userInfo = DBManager.getInstance().getUserInfo(mSessionId); if (userInfo != null) { mData.clear(); GroupMember newMember = new GroupMember(mSessionId, userInfo.getUserId(), userInfo.getName(), userInfo.getPortraitUri().toString(), userInfo.getName(), PinyinUtils.getPinyin(userInfo.getName()), PinyinUtils.getPinyin(userInfo.getName()), "", "", ""); mData.add(newMember); mData.add(new GroupMember("", "", ""));//+ } mIsCreateNewGroup = true; } else { List<GroupMember> groupMembers = DBManager.getInstance().getGroupMembers(mSessionId); if (groupMembers != null && groupMembers.size() > 0) { Groups groupsById = DBManager.getInstance().getGroupsById(mSessionId); if (groupsById != null && groupsById.getRole().equals("0")) { mIsManager = true; } mData.clear(); mData.addAll(groupMembers); mData.add(new GroupMember("", "", ""));//+ if (mIsManager) { mData.add(new GroupMember("", "", ""));//- } } mIsCreateNewGroup = false; } setAdapter(); }
Example #23
Source File: NewFriendAtPresenter.java From LQRWeChat with MIT License | 5 votes |
private void agreeFriends(String friendId, LQRViewHolderForRecyclerView helper) { if (!NetUtils.isNetworkAvailable(mContext)) { UIUtils.showToast(UIUtils.getString(R.string.please_check_net)); return; } ApiRetrofit.getInstance().agreeFriends(friendId) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .flatMap(new Func1<AgreeFriendsResponse, Observable<GetUserInfoByIdResponse>>() { @Override public Observable<GetUserInfoByIdResponse> call(AgreeFriendsResponse agreeFriendsResponse) { if (agreeFriendsResponse != null && agreeFriendsResponse.getCode() == 200) { helper.setViewVisibility(R.id.tvAdded, View.VISIBLE) .setViewVisibility(R.id.btnAck, View.GONE); return ApiRetrofit.getInstance().getUserInfoById(friendId); } return Observable.error(new ServerException(UIUtils.getString(R.string.agree_friend_fail))); } }) .subscribe(getUserInfoByIdResponse -> { if (getUserInfoByIdResponse != null && getUserInfoByIdResponse.getCode() == 200) { GetUserInfoByIdResponse.ResultEntity result = getUserInfoByIdResponse.getResult(); UserInfo userInfo = new UserInfo(UserCache.getId(), result.getNickname(), Uri.parse(result.getPortraitUri())); if (TextUtils.isEmpty(userInfo.getPortraitUri().toString())) { userInfo.setPortraitUri(Uri.parse(DBManager.getInstance().getPortraitUri(userInfo))); } Friend friend = new Friend(userInfo.getUserId(), userInfo.getName(), userInfo.getPortraitUri().toString()); DBManager.getInstance().saveOrUpdateFriend(friend); UIUtils.postTaskDelay(() -> { BroadcastManager.getInstance(UIUtils.getContext()).sendBroadcast(AppConst.UPDATE_FRIEND); BroadcastManager.getInstance(UIUtils.getContext()).sendBroadcast(AppConst.UPDATE_CONVERSATIONS); }, 1000); } }, this::loadError); }
Example #24
Source File: SessionAtPresenter.java From LQRWeChat with MIT License | 5 votes |
public void sendRedPacketMsg() { if (mConversationType == Conversation.ConversationType.PRIVATE) { UserInfo userInfo = DBManager.getInstance().getUserInfo(mSessionId); if (userInfo != null) RedPacketUtil.startRedPacket(mContext, userInfo, RPSendPacketCallback); } else { List<GroupMember> groupMembers = DBManager.getInstance().getGroupMembers(mSessionId); if (groupMembers != null) RedPacketUtil.startRedPacket(mContext, mSessionId, groupMembers.size(), RPSendPacketCallback); } }
Example #25
Source File: SessionAdapter.java From LQRWeChat with MIT License | 5 votes |
private void setAvatar(LQRViewHolderForRecyclerView helper, Message item, int position) { ImageView ivAvatar = helper.getView(R.id.ivAvatar); UserInfo userInfo = DBManager.getInstance().getUserInfo(item.getSenderUserId()); if (userInfo != null) { Glide.with(mContext).load(userInfo.getPortraitUri()).centerCrop().into(ivAvatar); } }
Example #26
Source File: SessionAdapter.java From LQRWeChat with MIT License | 5 votes |
private void setOnClick(LQRViewHolderForRecyclerView helper, Message item, int position) { helper.getView(R.id.llError).setOnClickListener(v -> RongIMClient.getInstance().deleteMessages(new int[]{item.getMessageId()}, new RongIMClient.ResultCallback<Boolean>() { @Override public void onSuccess(Boolean aBoolean) { mData.remove(position); mPresenter.setAdapter(); MessageContent content = item.getContent(); if (content instanceof TextMessage) { mPresenter.sendTextMsg(((TextMessage) content).getContent()); } else if (content instanceof ImageMessage) { mPresenter.sendImgMsg(((ImageMessage) content).getThumUri(), ((ImageMessage) content).getLocalUri()); } else if (content instanceof FileMessage) { mPresenter.sendFileMsg(new File(((FileMessage) content).getLocalPath().getPath())); } else if (content instanceof VoiceMessage) { VoiceMessage voiceMessage = (VoiceMessage) content; mPresenter.sendAudioFile(voiceMessage.getUri(), voiceMessage.getDuration()); } } @Override public void onError(RongIMClient.ErrorCode errorCode) { } }) ); helper.getView(R.id.ivAvatar).setOnClickListener(v -> { UserInfo userInfo = DBManager.getInstance().getUserInfo(item.getSenderUserId()); if (userInfo != null) { Intent intent = new Intent(mContext, UserInfoActivity.class); intent.putExtra("userInfo", userInfo); ((SessionActivity) mContext).jumpToActivity(intent); } }); }
Example #27
Source File: RealTimeLocationActivity.java From sealtalk-android with MIT License | 5 votes |
public void onEventMainThread(final RongEvent.RealTimeLocationReceiveEvent event) { String userId = event.getUserId(); UserInfo userInfo = getCacheUserInfoById(userId); if (userInfo != null) { moveMarker(new LatLng(event.getLatitude(), event.getLongitude()), userInfo); } }
Example #28
Source File: MultiVideoCallActivity.java From sealtalk-android with MIT License | 4 votes |
@Override public void onCallConnected(RongCallSession callSession, SurfaceView localVideo) { super.onCallConnected(callSession, localVideo); this.callSession = callSession; RongCallClient.getInstance().setEnableSpeakerphone(true); if (localView == null) { localView = localVideo; localViewContainer.addView(localView, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT)); localViewUserId = RongIMClient.getInstance().getCurrentUserId(); localView.setTag(localViewUserId); } localViewContainer.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!isFullScreen) { isFullScreen = true; topContainer.setVisibility(View.GONE); bottomButtonContainer.setVisibility(View.GONE); } else { isFullScreen = false; topContainer.setVisibility(View.VISIBLE); bottomButtonContainer.setVisibility(View.VISIBLE); } } }); bottomButtonContainer.removeAllViews(); FrameLayout bottomButtonLayout = (FrameLayout) inflater.inflate(R.layout.rc_voip_multi_video_calling_bottom_view, null); bottomButtonContainer.addView(bottomButtonLayout); topContainer.setVisibility(View.VISIBLE); minimizeButton.setVisibility(View.VISIBLE); addButton.setVisibility(View.VISIBLE); switchCameraButton.setVisibility(View.VISIBLE); waitingContainer.setVisibility(View.GONE); remoteViewContainer.setVisibility(View.VISIBLE); participantPortraitContainer.setVisibility(View.GONE); TextView remindInfo = (TextView) topContainer.findViewById(R.id.rc_voip_call_remind_info); setupTime(remindInfo); TextView userNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name); String currentUserId = RongIMClient.getInstance().getCurrentUserId(); UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(currentUserId); if (userInfo != null) { userNameView.setText(userInfo.getName()); } else { userNameView.setText(currentUserId); } updateRemoteVideoViews(callSession); }
Example #29
Source File: UserInfoEngine.java From sealtalk-android with MIT License | 4 votes |
public UserInfo getUserInfo() { return userInfo; }
Example #30
Source File: UserInfoEngine.java From sealtalk-android with MIT License | 4 votes |
public void setUserInfo(UserInfo userInfo) { this.userInfo = userInfo; }