本文整理汇总了Java中io.rong.imkit.widget.AsyncImageView.setResource方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncImageView.setResource方法的具体用法?Java AsyncImageView.setResource怎么用?Java AsyncImageView.setResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.rong.imkit.widget.AsyncImageView
的用法示例。
在下文中一共展示了AsyncImageView.setResource方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
super.bindView(v, partition, data, position);
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
photo.setResource(res);
String userId = friend.getUserId();
holder.userId = userId;
}
示例2: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
TextView choice = holder.unreadnum;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
photo.setResource(res);
photo.setTag(position);
holder.friend = friend;
}
示例3: addMarker
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void addMarker(LatLng latLng, String url) {
AsyncImageView imageView = (AsyncImageView) LayoutInflater.from(this).inflate(R.layout.map_marker_view, null);
// AsyncImageView imageView = (AsyncImageView) view.findViewById(R.id.icon);
imageView.setResource(new Resource(url));
// aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
// .position(new LatLng(30.679879, 104.064855)).title("成都市")
// .snippet("成都市:30.679879, 104.064855").draggable(true));
MarkerOptions markerOption = new MarkerOptions();
markerOption.position(new LatLng(34.341568, 108.940174));
// markerOption.title("西安市").snippet("西安市:34.341568, 108.940174");
// markerOption.draggable(true);
// markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.rc_default_portrait));
markerOption.icon(BitmapDescriptorFactory.fromView(imageView));
// markerOption.icon(BitmapDescriptorFactory
// .defaultMarker(BitmapDescriptorFactory.HUE_RED));
Marker marker2 = aMap.addMarker(markerOption);
// marker旋转90度
// marker2.setRotateAngle(90);
}
示例4: initView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
protected void initView() {
getSupportActionBar().setTitle(R.string.de_actionbar_myacc);
mImgMyPortrait = (AsyncImageView) findViewById(R.id.img_my_portrait);
mMyPortrait = (RelativeLayout) findViewById(R.id.rl_my_portrait);
mMyUsername = (RelativeLayout) findViewById(R.id.rl_my_username);
mTVUsername = (TextView) findViewById(R.id.tv_my_username);
if (DemoContext.getInstance().getSharedPreferences() != null) {
// String userId = DemoContext.getInstance().getSharedPreferences().getString("DEMO_USER_ID", null);
mUserName = DemoContext.getInstance().getSharedPreferences().getString(Constants.APP_USER_NAME, null);
String userPortrait = DemoContext.getInstance().getSharedPreferences().getString("DEMO_USER_PORTRAIT", null);
mImgMyPortrait.setResource(new Resource(Uri.parse(userPortrait)));
mTVUsername.setText(mUserName.toString());
}
mMyPortrait.setOnClickListener(this);
mMyUsername.setOnClickListener(this);
// mResourceHandler = new ResourceHandler.Builder().enableBitmapCache().build(this);
}
示例5: onEventMainThread
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void onEventMainThread(UserInfo userInfo) {
if (targetId != null && targetId.equals(userInfo.getUserId())) {
TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name);
if (userInfo.getName() != null)
userName.setText(userInfo.getName());
AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
if (userPortrait != null && userInfo.getPortraitUri() != null) {
userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
示例6: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
super.bindView(v, partition, data, position);
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
photo.setResource(res);
String userId = friend.getUserId();
holder.userId = userId;
if (friend.isSelected()) {
holder.choice.setButtonDrawable(mContext.getResources().getDrawable(R.drawable.de_ui_friend_checkbox_gray));
holder.choice.setChecked(true);
holder.choice.setEnabled(false);
} else {
holder.choice.setEnabled(true);
holder.choice.setChecked(mChoiceFriendIds.contains(friend.getUserId()));
holder.choice.setButtonDrawable(mContext.getResources().getDrawable(R.drawable.de_ui_friend_check_selector));
}
}
示例7: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
super.bindView(v, partition, data, position);
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
if(friend.getUserId().equals("★001")){
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_new_friend));
}else if(friend.getUserId().equals("★002")){
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_group));
}else if(friend.getUserId().equals("★003")){
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_public));
}else{
photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
}
photo.setResource(res);
String userId = friend.getUserId();
holder.userId = userId;
}
示例8: setupIntent
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent() {
RongCallCommon.CallMediaType mediaType;
Intent intent = getIntent();
RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
// if (callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
// return;
// }
if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
callSession = intent.getParcelableExtra("callSession");
mediaType = callSession.getMediaType();
targetId = callSession.getInviterUserId();
} else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
mediaType = RongCallCommon.CallMediaType.AUDIO;
} else {
mediaType = RongCallCommon.CallMediaType.VIDEO;
}
Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.US));
targetId = intent.getStringExtra("targetId");
List<String> userIds = new ArrayList<>();
userIds.add(targetId);
RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
} else { // resume call
callSession = RongCallClient.getInstance().getCallSession();
mediaType = callSession.getMediaType();
}
if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
handFree = false;
} else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
handFree = true;
}
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 && userInfo.getPortraitUri() != null) {
userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
createPowerManager();
createPickupDetector();
}
示例9: setupIntent
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent() {
RongCallCommon.CallMediaType mediaType;
Intent intent = getIntent();
RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
// if (callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
// return;
// }
if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
callSession = intent.getParcelableExtra("callSession");
mediaType = callSession.getMediaType();
targetId = callSession.getInviterUserId();
} else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
mediaType = RongCallCommon.CallMediaType.AUDIO;
} else {
mediaType = RongCallCommon.CallMediaType.VIDEO;
}
Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.getDefault()));
targetId = intent.getStringExtra("targetId");
List<String> userIds = new ArrayList<>();
userIds.add(targetId);
RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
} else { // resume call
callSession = RongCallClient.getInstance().getCallSession();
mediaType = callSession.getMediaType();
}
if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
handFree = false;
} else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
handFree = true;
}
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.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
}
示例10: setupIntent
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent () {
RongCallCommon.CallMediaType mediaType;
Intent intent = getIntent();
RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
if (callAction == null || callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
return;
}
if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
callSession = intent.getParcelableExtra("callSession");
mediaType = callSession.getMediaType();
targetId = callSession.getInviterUserId();
} else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
mediaType = RongCallCommon.CallMediaType.AUDIO;
} else {
mediaType = RongCallCommon.CallMediaType.VIDEO;
}
Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.getDefault()));
targetId = intent.getStringExtra("targetId");
List<String> userIds = new ArrayList<>();
userIds.add(targetId);
RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
} else {
callSession = RongCallClient.getInstance().getCallSession();
mediaType = callSession.getMediaType();
}
if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
handFree = false;
} else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
handFree = true;
}
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.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
}
示例11: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
CheckBox choice = holder.choice;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
photo.setResource(res);
photo.setTag(position);
holder.friend = friend;
}
示例12: bindView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
ViewHolder holder = (ViewHolder) v.getTag();
TextView name = holder.name;
AsyncImageView photo = holder.photo;
TextView choice = holder.unreadnum;
Friend friend = data.get(position);
name.setText(friend.getNickname());
Resource res = new Resource(friend.getPortrait());
photo.setResource(res);
photo.setTag(position);
holder.friend = friend;
}
示例13: addMarker
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void addMarker(LatLng latLng, final UserInfo userInfo) {
final String url = userInfo.getPortraitUri().toString();
final MarkerOptions markerOption = new MarkerOptions();
markerOption.position(latLng);
View view = LayoutInflater.from(this).inflate(R.layout.rc_icon_rt_location_marker, null);
AsyncImageView imageView = (AsyncImageView) view.findViewById(android.R.id.icon);
ImageView locImageView = (ImageView) view.findViewById(android.R.id.icon1);
if (userInfo.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
locImageView.setImageResource(R.drawable.rc_rt_loc_myself);
} else {
locImageView.setImageResource(R.drawable.rc_rt_loc_other);
}
imageView.setResource(new Resource(url));
markerOption.anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromView(view));
Marker marker = getaMap().addMarker(markerOption);
marker.setObject(userInfo.getUserId());
}
示例14: addUserToView
import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void addUserToView(UserInfo userInfo) {
RLog.e(this, "RealTimeLocationHorizontalScrollView", "addUserToView:---" + userInfo.getUserId());
View view = mInflater.inflate(R.layout.item_horizontal_scroll_view, null);
AsyncImageView imageView = (AsyncImageView) view.findViewById(android.R.id.icon);
if (null != userInfo.getPortraitUri())
imageView.setResource(new Resource(userInfo.getPortraitUri()));
view.setTag(userInfo.getUserId());
addLayoutChildView(view);
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:14,代码来源:RealTimeLocationHorizontalScrollView.java