import com.lqr.wechat.util.PinyinUtils; //导入方法依赖的package包/类
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 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();
}