use of com.lingtuan.firefly.contact.vo.NewContactVO in project SmartMesh_Android by SmartMeshFoundation.
the class SelectContactUI method clickSelectVo.
/*Click on the navigation bar at the bottom of a multiple-choice avatar to delete the user*/
private void clickSelectVo(ImageView imageView) {
int count = mContactList.size();
for (int i = 0; i < count; i++) {
NewContactVO baseVo = (NewContactVO) mContactList.get(i);
if (baseVo.getLocalId().equals(imageView.getTag())) {
baseVo.setChecked(!baseVo.isChecked());
mNewContactListAdapter.notifyDataSetChanged();
if (mSearchAdapter != null) {
mSearchAdapter.notifyDataSetChanged();
}
break;
}
}
mHorizontalScrollViewContent.removeView(imageView);
int selectCount = selectList.size();
for (int i = 0; i < selectCount; i++) {
UserBaseVo vo = selectList.get(i);
if (vo.getLocalId().equals(imageView.getTag())) {
selectList.remove(i);
break;
}
}
if (hasSelectList == null && selectList.size() <= 0) {
if (mFinishBtn.isEnabled()) {
mFinishBtn.setEnabled(false);
}
}
if (hasSelectList != null) {
// Over the selected user data
int hasSelectCount = hasSelectList.size();
for (int i = 0; i < hasSelectCount; i++) {
UserBaseVo vo = hasSelectList.get(i);
if (vo.getLocalId().equals(imageView.getTag())) {
hasSelectList.remove(i);
break;
}
}
}
}
use of com.lingtuan.firefly.contact.vo.NewContactVO in project SmartMesh_Android by SmartMeshFoundation.
the class NewContactListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ContactHolder holder;
if (convertView == null) {
holder = new ContactHolder();
convertView = View.inflate(mContext, resource, null);
holder.mAvatar = (ImageView) convertView.findViewById(R.id.invite_avatar);
holder.nickName = (TextView) convertView.findViewById(R.id.nearby_nickname);
holder.offlineImg = (ImageView) convertView.findViewById(R.id.offlineImg);
holder.checkBox = (CheckBox) convertView.findViewById(R.id.checkbox);
convertView.setTag(holder);
} else {
holder = (ContactHolder) convertView.getTag();
}
NewContactVO item = (NewContactVO) getItem(position);
showSectionViewIfFirstItem(convertView, item, position);
int nickColor = R.color.black;
holder.nickName.setTextColor(mContext.getResources().getColor(nickColor));
holder.nickName.setText(item.getShowName());
if (item.isOffLine()) {
holder.offlineImg.setVisibility(View.VISIBLE);
} else {
holder.offlineImg.setVisibility(View.GONE);
}
NextApplication.displayCircleImage(holder.mAvatar, item.getThumb());
if (// multiple
isMultipleChoice) {
if (item.isCantChecked()) {
holder.checkBox.setVisibility(View.VISIBLE);
holder.checkBox.setButtonDrawable(R.drawable.checkbox_cant_selected);
} else {
holder.checkBox.setVisibility(View.VISIBLE);
if (item.isChecked()) {
holder.checkBox.setButtonDrawable(R.drawable.checkbox_selected);
} else {
holder.checkBox.setButtonDrawable(R.drawable.checkbox_unselected);
}
}
}
return convertView;
}
Aggregations