use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class ContactSelectedUI method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if ((requestCode == 0 || requestCode == 1000) && resultCode == RESULT_OK) {
ArrayList<UserBaseVo> selectList = (ArrayList<UserBaseVo>) data.getSerializableExtra("selectList");
if (selectList == null || selectList.isEmpty()) {
return;
}
UserBaseVo userBaseVo = selectList.get(0);
showDialogFormat(userBaseVo.getLocalId(), userBaseVo.getUsername(), userBaseVo.getThumb(), userBaseVo.getGender(), false, selectList);
} else if (requestCode == 10 && resultCode == RESULT_OK) {
final String uid = data.getStringExtra("uid");
final String avatarUrl = data.getStringExtra("avatarurl");
final String username = data.getStringExtra("username");
final String gender = data.getStringExtra("gender");
final boolean isNewGroup = data.getBooleanExtra("isNewGroup", false);
// if(cantTrans(uid)){
// return;
// }
ArrayList<UserBaseVo> members = new ArrayList<>();
members = (ArrayList<UserBaseVo>) data.getSerializableExtra("member");
showDialogFormat(uid, username, avatarUrl, gender, isNewGroup, members);
} else if (requestCode == 100 && resultCode == RESULT_OK) {
final String gid = data.getStringExtra("gid");
final String avatarUrl = data.getStringExtra("avatarurl");
final String username = data.getStringExtra("groupName");
final String gender = data.getStringExtra("gender");
final boolean isNewGroup = data.getBooleanExtra("isNewGroup", false);
// if(cantTrans(gid)){
// return;
// }
List<UserBaseVo> members = new ArrayList<>();
UserBaseVo vo = new UserBaseVo();
vo.setThumb(avatarUrl);
members.add(vo);
showDialogFormat(gid, username, avatarUrl, gender, isNewGroup, members);
}
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupListUI method onActivityResult.
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 0 && resultCode == RESULT_OK) {
// Select the contact to return
ArrayList<UserBaseVo> selectList = (ArrayList<UserBaseVo>) data.getSerializableExtra("selectList");
if (selectList != null && selectList.size() == 1) {
UserBaseVo vo = selectList.get(0);
Utils.intentChattingUI(DiscussGroupListUI.this, vo.getLocalId(), vo.getThumb(), vo.getShowName(), vo.getGender(), vo.getFriendLog(), false, false, false, 0, true);
} else if (selectList != null && selectList.size() > 1) {
StringBuilder touids = new StringBuilder();
for (UserBaseVo vo : selectList) {
touids.append(vo.getLocalId()).append(",");
}
touids.deleteCharAt(touids.lastIndexOf(","));
createDiscussionGroups(touids.toString(), selectList);
}
}
super.onActivityResult(requestCode, resultCode, data);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupListUI method onItemClick.
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
DiscussionGroupsVo gVo = source.get(position);
String uid = "group-" + gVo.getCid();
String username = gVo.getName();
StringBuilder sb = new StringBuilder();
for (UserBaseVo vo : gVo.getMembers()) {
sb.append(vo.getThumb()).append("___").append(vo.getGender()).append("#");
}
sb.deleteCharAt(sb.lastIndexOf("#"));
String url = sb.toString();
if (isSingleSelect) {
Intent intent = new Intent();
intent.putExtra("uid", uid);
intent.putExtra("username", username);
intent.putExtra("avatarurl", url);
intent.putExtra("isgroup", true);
ArrayList<UserBaseVo> members = new ArrayList<>();
int max = gVo.getMembers().size() <= 5 ? gVo.getMembers().size() : 5;
for (int i = 0; i < max; i++) {
members.add(gVo.getMembers().get(i));
}
intent.putExtra("member", members);
setResult(RESULT_OK, intent);
Utils.exitActivityAndBackAnim(this, true);
return;
}
Utils.intentChattingUI(this, uid, url, username, "1", 0, true, false, false, 0, true);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupMemberListUI method addMembers.
public void addMembers() {
ArrayList<String> alreadySelected = new ArrayList<String>();
for (int i = 0; i < data.size(); i++) {
UserBaseVo info = data.get(i);
if (!TextUtils.isEmpty(info.getLocalId()) && !info.getLocalId().equals(NextApplication.myInfo.getLocalId())) {
alreadySelected.add(info.getLocalId());
}
}
Intent intent = new Intent(DiscussGroupMemberListUI.this, SelectContactUI.class);
intent.putExtra("cantSelectList", alreadySelected);
intent.putExtra("isMultipleChoice", true);
startActivityForResult(intent, 0);
Utils.openNewActivityAnim(DiscussGroupMemberListUI.this, false);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupMemberListUI method inviteOthersChatMsg.
private void inviteOthersChatMsg(final String name) {
StringBuilder sb = new StringBuilder();
int index = 1;
for (UserBaseVo vo : data) {
if (// Most need four pictures
index > 4) {
break;
}
sb.append(vo.getThumb()).append("___").append(vo.getGender()).append("#");
index++;
}
sb.deleteCharAt(sb.lastIndexOf("#"));
String url = sb.toString();
ChatMsg chatmsg = new ChatMsg();
chatmsg.setChatId("group-" + cid);
chatmsg.setGroupName(name);
chatmsg.setGroup(true);
chatmsg.setType(13);
chatmsg.setSend(1);
chatmsg.setContent(getString(R.string.discuss_group_invite_others, name));
chatmsg.setMsgTime(System.currentTimeMillis() / 1000);
chatmsg.setMessageId(UUID.randomUUID().toString());
chatmsg.parseUserBaseVo(NextApplication.myInfo.getUserBaseVo());
Bundle bundle = new Bundle();
bundle.putSerializable(XmppAction.ACTION_MESSAGE_LISTENER, chatmsg);
Utils.intentAction(getApplicationContext(), XmppAction.ACTION_MESSAGE_LISTENER, bundle);
FinalUserDataBase.getInstance().saveChatMsg(chatmsg, chatmsg.getChatId(), name, url, false);
}
Aggregations