use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupMemberListUI method removeMember.
public void removeMember(final int arg2) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
mProgressDialog = LoadingDialog.showDialog(this, null, null);
mProgressDialog.setCancelable(false);
NetRequestImpl.getInstance().removeDiscussMember(data.get(arg2).getLocalId(), cid, new RequestListener() {
@Override
public void start() {
}
@Override
public void success(JSONObject response) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(response.optString("msg"));
UserBaseVo user = data.get(arg2);
data.remove(user);
showdata.remove(user);
removeMemberChatMsg(user.getShowName());
mAdapter.notifyDataSetChanged();
}
@Override
public void error(int errorCode, String errorMsg) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
showToast(errorMsg);
}
});
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupSettingUI method resetlist.
private void resetlist() {
int size = 0;
if (isAdmin) {
size = data.size() <= 38 ? data.size() : 38;
} else {
size = data.size() <= 39 ? data.size() : 39;
}
showdata.clear();
for (int i = 0; i < size; i++) {
showdata.add(data.get(i));
}
if (isAdmin) {
showdata.add(new UserBaseVo());
showdata.add(new UserBaseVo());
} else {
showdata.add(new UserBaseVo());
}
allNum.setText(getString(R.string.discuss_all, data.size()));
adapter.notifyDataSetChanged();
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupSettingUI method addMembers.
public void addMembers() {
ArrayList<String> alreadySelected = new ArrayList<>();
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(DiscussGroupSettingUI.this, SelectContactUI.class);
intent.putExtra("cantSelectList", alreadySelected);
intent.putExtra("isMultipleChoice", true);
startActivityForResult(intent, 0);
Utils.openNewActivityAnim(DiscussGroupSettingUI.this, false);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class DiscussGroupSettingUI method removeMemberChatMsg.
/**
* Forge a delete members of the group chat message
*/
private void removeMemberChatMsg(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(nameEdit.getText().toString());
chatmsg.setGroup(true);
chatmsg.setType(14);
chatmsg.setSend(1);
chatmsg.setContent(getString(R.string.discuss_group_remove_other, 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(), nameEdit.getText().toString(), url, false);
}
use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.
the class SelectContactUI method findViewById.
@Override
protected void findViewById() {
if (getIntent() != null) {
cantSelectList = (ArrayList<String>) getIntent().getSerializableExtra("cantSelectList");
hasSelectList = (ArrayList<UserBaseVo>) getIntent().getSerializableExtra("hasSelectList");
isMultipleChoice = getIntent().getBooleanExtra("isMultipleChoice", false);
}
mTitle = (TextView) findViewById(R.id.app_title);
mTitleRela = (RelativeLayout) findViewById(R.id.app_title_rela);
mNewListView = (ListView) findViewById(R.id.contact_list);
mSelectContactBg = (LinearLayout) findViewById(R.id.contact_select_bg);
mHorizontalScrollView = (HorizontalScrollView) findViewById(R.id.contact_horizontalscrollview);
mHorizontalScrollViewContent = (LinearLayout) findViewById(R.id.contact_horizontalscrollview_content);
mFinishBtn = (TextView) findViewById(R.id.contact_select_finish);
if (isMultipleChoice) {
mSelectContactBg.setVisibility(View.VISIBLE);
}
if (hasSelectList != null) {
mFinishBtn.setEnabled(true);
}
swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container);
swipeLayout.setColorSchemeResources(R.color.black);
View headerView0 = View.inflate(this, R.layout.include_friends_header_search, null);
initSearchData(headerView0);
mNewListView.addHeaderView(headerView0);
View footerView = View.inflate(this, R.layout.include_friends_footer, null);
contactNum = (TextView) footerView.findViewById(R.id.include_contact_num);
mNewListView.addFooterView(footerView);
contactNum.setText(getString(R.string.contact_num, 0));
mNewContactListAdapter = new NewContactListAdapter(this, R.layout.contact_child_item, mContactList, isMultipleChoice);
mNewListView.setAdapter(mNewContactListAdapter);
}
Aggregations