本文整理汇总了Java中io.rong.imkit.widget.AsyncImageView.setAvatar方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncImageView.setAvatar方法的具体用法?Java AsyncImageView.setAvatar怎么用?Java AsyncImageView.setAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.rong.imkit.widget.AsyncImageView
的用法示例。
在下文中一共展示了AsyncImageView.setAvatar方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAudioCallView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
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);
if (pickupDetector != null) {
pickupDetector.register(this);
}
}
示例2: addSingleRemoteView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
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;
}
示例3: updateChildInfo
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
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.findViewById(R.id.rc_user_portrait);
imageView.setAvatar(userInfo.getPortraitUri());
if (enableTitle) {
TextView textView = (TextView)child.findViewById(R.id.rc_user_name);
textView.setText(userInfo.getName());
}
}
}
}
示例4: updateChildInfo
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
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());
}
}
}
}
示例5: getView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(R.layout.rc_gridview_item_contact_group_members, parent, false);
}
AsyncImageView iv_avatar = (AsyncImageView) convertView.findViewById(R.id.iv_avatar);
TextView tv_username = (TextView) convertView.findViewById(R.id.tv_username);
final UserInfo member = list.get(position);
tv_username.setText(member.getName());
iv_avatar.setAvatar(member.getPortraitUri());
return convertView;
}
示例6: initAudioCallView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
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);
}
示例7: onRestoreFloatBox
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
public void onRestoreFloatBox(Bundle bundle) {
super.onRestoreFloatBox(bundle);
if (bundle == null)
return;
muted = bundle.getBoolean("muted");
handFree = bundle.getBoolean("handFree");
setShouldShowFloat(true);
callSession = RongCallClient.getInstance().getCallSession();
RongCallCommon.CallMediaType mediaType = callSession.getMediaType();
RongCallAction callAction = RongCallAction.valueOf(getIntent().getStringExtra("callAction"));
inflater = LayoutInflater.from(this);
initView(mediaType, callAction);
targetId = callSession.getTargetId();
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 (mediaType.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);
}
}
}
SurfaceView localVideo = null;
SurfaceView remoteVideo = null;
String remoteUserId = null;
for (CallUserProfile profile : callSession.getParticipantProfileList()) {
if (profile.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
localVideo = profile.getVideoView();
} else {
remoteVideo = profile.getVideoView();
remoteUserId = profile.getUserId();
}
}
if (localVideo != null && localVideo.getParent() != null) {
((ViewGroup) localVideo.getParent()).removeView(localVideo);
}
onCallOutgoing(callSession, localVideo);
onCallConnected(callSession, localVideo);
if (remoteVideo != null && remoteVideo.getParent() != null) {
((ViewGroup) remoteVideo.getParent()).removeView(remoteVideo);
}
onRemoteUserJoined(remoteUserId, mediaType, remoteVideo);
}
示例8: onSwitchRemoteUsers
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void onSwitchRemoteUsers(View view) {
String from = (String) view.getTag();
if (from == null)
return;
String to = (String) localView.getTag();
FrameLayout layout = (FrameLayout) view;
SurfaceView fromView = (SurfaceView) layout.getChildAt(0);
SurfaceView toView = localView;
localViewContainer.removeAllViews();
layout.removeAllViews();
View singleRemoteView = remoteViewContainer.findViewWithTag(from + "view");
UserInfo toUserInfo = RongContext.getInstance().getUserInfoFromCache(to);
UserInfo fromUserInfo = RongContext.getInstance().getUserInfoFromCache(from);
AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
TextView backUserNameView = (TextView) singleRemoteView.findViewById(R.id.user_name);
if (toUserInfo != null) {
if (toUserInfo.getPortraitUri() != null) {
userPortraitView.setAvatar(toUserInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
backUserNameView.setText(toUserInfo.getName());
} else {
backUserNameView.setText(to);
}
singleRemoteView.setTag(to + "view");
fromView.setZOrderOnTop(false);
fromView.setZOrderMediaOverlay(false);
localViewContainer.addView(fromView);
toView.setZOrderOnTop(true);
toView.setZOrderMediaOverlay(true);
layout.addView(toView);
TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
topUserNameView.setTag(from + "name");
if (fromUserInfo != null) {
topUserNameView.setText(fromUserInfo.getName());
} else {
topUserNameView.setText(from);
}
layout.setTag(to);
localView = fromView;
localView.setTag(from);
localViewUserId = from;
}
示例9: onRestoreFloatBox
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
public void onRestoreFloatBox(Bundle bundle) {
super.onRestoreFloatBox(bundle);
if (bundle == null)
return;
muted = bundle.getBoolean("muted");
handFree = bundle.getBoolean("handFree");
callSession = RongCallClient.getInstance().getCallSession();
RongCallCommon.CallMediaType mediaType = callSession.getMediaType();
RongCallAction callAction = RongCallAction.valueOf(getIntent().getStringExtra("callAction"));
inflater = LayoutInflater.from(this);
initView(mediaType, callAction);
targetId = callSession.getTargetId();
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 (mediaType.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);
}
}
}
SurfaceView localVideo = null;
SurfaceView remoteVideo = null;
String remoteUserId = null;
for (CallUserProfile profile : callSession.getParticipantProfileList()) {
if (profile.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
localVideo = profile.getVideoView();
} else {
remoteVideo = profile.getVideoView();
remoteUserId = profile.getUserId();
}
}
if (localVideo != null && localVideo.getParent() != null) {
((ViewGroup)localVideo.getParent()).removeView(localVideo);
}
onCallOutgoing(callSession, localVideo);
onCallConnected(callSession, localVideo);
if (remoteVideo != null && remoteVideo.getParent() != null) {
((ViewGroup)remoteVideo.getParent()).removeView(remoteVideo);
}
onRemoteUserJoined(remoteUserId, mediaType, remoteVideo);
}
示例10: onSwitchRemoteUsers
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void onSwitchRemoteUsers(View view) {
String from = (String) view.getTag();
if (from == null)
return;
String to = (String) localView.getTag();
FrameLayout layout = (FrameLayout) view;
SurfaceView fromView = (SurfaceView) layout.getChildAt(0);
SurfaceView toView = localView;
localViewContainer.removeAllViews();
layout.removeAllViews();
View singleRemoteView = remoteViewContainer.findViewWithTag(from + "view");
UserInfo toUserInfo = RongContext.getInstance().getUserInfoFromCache(to);
UserInfo fromUserInfo = RongContext.getInstance().getUserInfoFromCache(from);
AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
TextView backUserNameView = (TextView) singleRemoteView.findViewById(R.id.user_name);
if (toUserInfo != null) {
if (toUserInfo.getPortraitUri() != null) {
userPortraitView.setAvatar(toUserInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
backUserNameView.setText(toUserInfo.getName());
} else {
backUserNameView.setText(to);
}
singleRemoteView.setTag(to + "view");
fromView.setZOrderOnTop(false);
fromView.setZOrderMediaOverlay(false);
localViewContainer.addView(fromView);
toView.setZOrderOnTop(true);
toView.setZOrderMediaOverlay(true);
layout.addView(toView);
TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
if (fromUserInfo != null) {
topUserNameView.setText(fromUserInfo.getName());
} else {
topUserNameView.setText(from);
}
layout.setTag(to);
localView = fromView;
localView.setTag(from);
localViewUserId = from;
}
示例11: addChild
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void addChild(String childId, UserInfo userInfo, String state) {
int containerCount = linearLayout.getChildCount();
LinearLayout lastContainer = null;
int i;
for (i = 0; i < containerCount; i++) {
LinearLayout container = (LinearLayout)linearLayout.getChildAt(i);
if (container.getChildCount() < CHILDREN_PER_LINE) {
lastContainer = container;
break;
}
}
if (lastContainer == null) {
lastContainer = new LinearLayout(context);
lastContainer.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
lastContainer.setGravity(Gravity.CENTER);
lastContainer.setPadding(0, dip2pix(CHILDREN_SPACE), 0, 0);
linearLayout.addView(lastContainer);
}
LinearLayout child = (LinearLayout)LayoutInflater.from(context).inflate(R.layout.rc_voip_user_info, null);
child.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
child.setPadding(0, 0, dip2pix(CHILDREN_SPACE), 0);
child.setTag(childId);
if (portraitSize > 0) {
child.findViewById(R.id.rc_user_portrait_layout).setLayoutParams(new LinearLayout.LayoutParams(portraitSize, portraitSize));
}
AsyncImageView imageView = (AsyncImageView)child.findViewById(R.id.rc_user_portrait);
TextView name = (TextView)child.findViewById(R.id.rc_user_name);
name.setVisibility(enableTitle ? VISIBLE : GONE);
TextView stateV = (TextView)child.findViewById(R.id.rc_voip_member_state);
stateV.setVisibility(enableTitle ? VISIBLE : GONE);
if (state != null) {
stateV.setText(state);
} else {
stateV.setVisibility(GONE);
}
if (userInfo != null) {
imageView.setAvatar(userInfo.getPortraitUri());
name.setText(userInfo.getName() == null ? userInfo.getUserId() : userInfo.getName());
} else {
name.setText(childId);
}
lastContainer.addView(child);
}
示例12: onRestoreFloatBox
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
public void onRestoreFloatBox(Bundle bundle) {
super.onRestoreFloatBox(bundle);
if (bundle == null)
return;
muted = bundle.getBoolean("muted");
handFree = bundle.getBoolean("handFree");
setShouldShowFloat(true);
callSession = RongCallClient.getInstance().getCallSession();
RongCallCommon.CallMediaType mediaType = callSession.getMediaType();
RongCallAction callAction = RongCallAction.valueOf(getIntent().getStringExtra("callAction"));
inflater = LayoutInflater.from(this);
initView(mediaType, callAction);
targetId = callSession.getTargetId();
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 (mediaType.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);
}
}
}
SurfaceView localVideo = null;
SurfaceView remoteVideo = null;
String remoteUserId = null;
for (CallUserProfile profile : callSession.getParticipantProfileList()) {
if (profile.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
localVideo = profile.getVideoView();
} else {
remoteVideo = profile.getVideoView();
remoteUserId = profile.getUserId();
}
}
if (localVideo != null && localVideo.getParent() != null) {
((ViewGroup) localVideo.getParent()).removeView(localVideo);
}
onCallOutgoing(callSession, localVideo);
onCallConnected(callSession, localVideo);
if (remoteVideo != null && remoteVideo.getParent() != null) {
((ViewGroup) remoteVideo.getParent()).removeView(remoteVideo);
onRemoteUserJoined(remoteUserId, mediaType, remoteVideo);
}
}
示例13: onSwitchRemoteUsers
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void onSwitchRemoteUsers(View view) {
String from = (String) view.getTag();
if (from == null)
return;
String to = (String) localView.getTag();
FrameLayout layout = (FrameLayout) view;
SurfaceView fromView = (SurfaceView) layout.getChildAt(0);
SurfaceView toView = localView;
if (fromView == null || toView == null) {
return;
}
localViewContainer.removeAllViews();
layout.removeAllViews();
View singleRemoteView = remoteViewContainer.findViewWithTag(from + "view");
UserInfo toUserInfo = RongContext.getInstance().getUserInfoFromCache(to);
UserInfo fromUserInfo = RongContext.getInstance().getUserInfoFromCache(from);
AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
TextView backUserNameView = (TextView) singleRemoteView.findViewById(R.id.user_name);
if (toUserInfo != null) {
if (toUserInfo.getPortraitUri() != null) {
userPortraitView.setAvatar(toUserInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
backUserNameView.setText(toUserInfo.getName());
} else {
backUserNameView.setText(to);
}
singleRemoteView.setTag(to + "view");
fromView.setZOrderOnTop(false);
fromView.setZOrderMediaOverlay(false);
localViewContainer.addView(fromView);
toView.setZOrderOnTop(true);
toView.setZOrderMediaOverlay(true);
layout.addView(toView);
TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
topUserNameView.setTag(from + "name");
if (fromUserInfo != null) {
topUserNameView.setText(fromUserInfo.getName());
} else {
topUserNameView.setText(from);
}
layout.setTag(to);
localView = fromView;
localView.setTag(from);
localViewUserId = from;
}