Search in sources :

Example 6 with NewContactVO

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;
            }
        }
    }
}
Also used : NewContactVO(com.lingtuan.firefly.contact.vo.NewContactVO) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 7 with NewContactVO

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;
}
Also used : NewContactVO(com.lingtuan.firefly.contact.vo.NewContactVO)

Aggregations

NewContactVO (com.lingtuan.firefly.contact.vo.NewContactVO)7 UserBaseVo (com.lingtuan.firefly.vo.UserBaseVo)4 Handler (android.os.Handler)2 View (android.view.View)2 OnClickListener (android.view.View.OnClickListener)2 AdapterView (android.widget.AdapterView)2 HorizontalScrollView (android.widget.HorizontalScrollView)2 ImageView (android.widget.ImageView)2 LinearLayout (android.widget.LinearLayout)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 SuppressLint (android.annotation.SuppressLint)1 Intent (android.content.Intent)1 ContactItemComparator (com.lingtuan.firefly.custom.contact.ContactItemComparator)1 RequestListener (com.lingtuan.firefly.listener.RequestListener)1 ArrayList (java.util.ArrayList)1 JSONObject (org.json.JSONObject)1