本文整理汇总了Java中com.lqr.wechat.util.RongGenerate.generateDefaultAvatar方法的典型用法代码示例。如果您正苦于以下问题:Java RongGenerate.generateDefaultAvatar方法的具体用法?Java RongGenerate.generateDefaultAvatar怎么用?Java RongGenerate.generateDefaultAvatar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lqr.wechat.util.RongGenerate
的用法示例。
在下文中一共展示了RongGenerate.generateDefaultAvatar方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPortraitUri
import com.lqr.wechat.util.RongGenerate; //导入方法依赖的package包/类
/**
* 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;
}
示例2: saveOrUpdateFriend
import com.lqr.wechat.util.RongGenerate; //导入方法依赖的package包/类
public synchronized void saveOrUpdateFriend(Friend friend) {
if (friend != null) {
String portrait = friend.getPortraitUri();
if (TextUtils.isEmpty(portrait)) {
portrait = RongGenerate.generateDefaultAvatar(friend.getName(), friend.getUserId());
friend.setPortraitUri(portrait);
}
friend.saveOrUpdate("userid = ?", friend.getUserId());
//更新过本地好友数据后,清空内存中对应用户信息缓存
if (mUserInfoCache != null && mUserInfoCache.containsKey(friend.getUserId())) {
mUserInfoCache.remove(friend.getUserId());
}
}
}
示例3: saveOrUpdateGroup
import com.lqr.wechat.util.RongGenerate; //导入方法依赖的package包/类
public synchronized void saveOrUpdateGroup(Groups groups) {
if (groups != null) {
String portrait = groups.getPortraitUri();
if (TextUtils.isEmpty(portrait)) {
portrait = RongGenerate.generateDefaultAvatar(groups.getName(), groups.getGroupId());
groups.setPortraitUri(portrait);
}
groups.saveOrUpdate("groupid = ?", groups.getGroupId());
}
}
示例4: saveGroups
import com.lqr.wechat.util.RongGenerate; //导入方法依赖的package包/类
public synchronized void saveGroups(List<GetGroupResponse.ResultEntity> list) {
if (list != null && list.size() > 0) {
mGroupsList = new ArrayList<>();
for (GetGroupResponse.ResultEntity groups : list) {
String portrait = groups.getGroup().getPortraitUri();
if (TextUtils.isEmpty(portrait)) {
portrait = RongGenerate.generateDefaultAvatar(groups.getGroup().getName(), groups.getGroup().getId());
}
mGroupsList.add(new Groups(groups.getGroup().getId(), groups.getGroup().getName(), portrait, String.valueOf(groups.getRole())));
}
}
if (mGroupsList.size() > 0)
DataSupport.saveAll(mGroupsList);
}
示例5: saveOrUpdateGroupMember
import com.lqr.wechat.util.RongGenerate; //导入方法依赖的package包/类
public synchronized void saveOrUpdateGroupMember(GroupMember groupMember) {
if (groupMember != null) {
String portrait = groupMember.getPortraitUri();
if (TextUtils.isEmpty(portrait)) {
portrait = RongGenerate.generateDefaultAvatar(groupMember.getName(), groupMember.getUserId());
groupMember.setPortraitUri(portrait);
}
groupMember.saveOrUpdate("groupid = ? and userid = ?", groupMember.getGroupId(), groupMember.getUserId());
}
}