Search in sources :

Example 21 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class ContactSearchAdapter method getView.

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    Holder h;
    if (convertView == null) {
        h = new Holder();
        convertView = View.inflate(mContext, R.layout.contact_child_item, null);
        h.mAvatar = (ImageView) convertView.findViewById(R.id.invite_avatar);
        h.nickName = (TextView) convertView.findViewById(R.id.nearby_nickname);
        h.checkBox = (CheckBox) convertView.findViewById(R.id.checkbox);
        convertView.setTag(h);
    } else {
        h = (Holder) convertView.getTag();
    }
    UserBaseVo vo = friendList.get(position);
    int nickColor = R.color.black;
    h.nickName.setTextColor(mContext.getResources().getColor(nickColor));
    h.nickName.setText(vo.getShowName());
    NextApplication.displayCircleImage(h.mAvatar, vo.getThumb());
    if (isMultipleChoice) {
        // multi-select
        if (vo.isCantChecked()) {
            h.checkBox.setVisibility(View.VISIBLE);
            h.checkBox.setButtonDrawable(R.drawable.checkbox_cant_selected);
        } else {
            h.checkBox.setVisibility(View.VISIBLE);
            if (vo.isChecked()) {
                h.checkBox.setButtonDrawable(R.drawable.checkbox_selected);
            } else {
                h.checkBox.setButtonDrawable(R.drawable.checkbox_unselected);
            }
        }
    }
    return convertView;
}
Also used : UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 22 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class DiscussGroupAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    NearHolder holder;
    if (convertView == null) {
        holder = new NearHolder();
        convertView = View.inflate(c, R.layout.discuss_group_item, null);
        holder.nickName = (TextView) convertView.findViewById(R.id.group_nickname);
        holder.avatar = (DiscussGroupImageView) convertView.findViewById(R.id.group_avatar);
        convertView.setTag(holder);
    } else {
        holder = (NearHolder) convertView.getTag();
    }
    DiscussionGroupsVo group = sourceList.get(position);
    holder.nickName.setText(group.getName());
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < group.getMembers().size(); i++) {
        UserBaseVo member = group.getMembers().get(i);
        if (i == group.getMembers().size() - 1) {
            sb.append(member.getShowName());
        } else {
            sb.append(member.getShowName() + ",");
        }
    }
    holder.avatar.setMember(group.getMembers());
    return convertView;
}
Also used : DiscussionGroupsVo(com.lingtuan.firefly.contact.vo.DiscussionGroupsVo) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 23 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class DiscussGroupMemberListAdapter method getView.

@Override
public View getView(final int position, View convertView, ViewGroup parent) {
    Holder h;
    if (convertView == null) {
        h = new Holder();
        convertView = View.inflate(mContext, R.layout.discuss_group_member_list_item, null);
        h.mAvatar = (ImageView) convertView.findViewById(R.id.invite_avatar);
        h.mNickname = (TextView) convertView.findViewById(R.id.invite_nickname);
        convertView.setTag(h);
    } else {
        h = (Holder) convertView.getTag();
    }
    UserBaseVo uInfo = mList.get(position);
    h.mNickname.setText(uInfo.getShowName());
    NextApplication.displayCircleImage(h.mAvatar, uInfo.getThumb());
    return convertView;
}
Also used : UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 24 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class ContactSearchNickUI method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    UserBaseVo baseVo = mAdapter.getItem(position);
    Utils.intentFriendUserInfo(this, baseVo, false);
}
Also used : UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Example 25 with UserBaseVo

use of com.lingtuan.firefly.vo.UserBaseVo in project SmartMesh_Android by SmartMeshFoundation.

the class ContactSelectedUI method onItemClick.

@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    if (position == 0) {
        return;
    }
    final ChatMsg msg = mAdapter.getItem(position - 1);
    // if(cantTrans(msg.getChatId())){
    // return;
    // }
    List<UserBaseVo> members = msg.getMemberAvatarUserBaseList();
    if (members == null || members.size() == 0) {
        members = new ArrayList<>();
        UserBaseVo vo = new UserBaseVo();
        vo.setGender(msg.getGender() + "");
        vo.setThumb(msg.getUserImage());
        vo.setUsername(msg.getUsername());
        members.add(vo);
    }
    showDialogFormat(msg.getChatId(), msg.getUsername(), msg.getUserImage(), msg.getGender() + "", msg.isGroup(), members);
}
Also used : ChatMsg(com.lingtuan.firefly.vo.ChatMsg) UserBaseVo(com.lingtuan.firefly.vo.UserBaseVo)

Aggregations

UserBaseVo (com.lingtuan.firefly.vo.UserBaseVo)53 ArrayList (java.util.ArrayList)13 ChatMsg (com.lingtuan.firefly.vo.ChatMsg)9 Cursor (android.database.Cursor)7 View (android.view.View)7 ListView (android.widget.ListView)7 TextView (android.widget.TextView)7 Intent (android.content.Intent)6 ImageView (android.widget.ImageView)6 JSONObject (org.json.JSONObject)6 Bundle (android.os.Bundle)5 AdapterView (android.widget.AdapterView)5 OnClickListener (android.view.View.OnClickListener)4 HorizontalScrollView (android.widget.HorizontalScrollView)4 DiscussionGroupsVo (com.lingtuan.firefly.contact.vo.DiscussionGroupsVo)4 NewContactVO (com.lingtuan.firefly.contact.vo.NewContactVO)4 RequestListener (com.lingtuan.firefly.listener.RequestListener)4 Handler (android.os.Handler)3 Editable (android.text.Editable)3 LinearLayout (android.widget.LinearLayout)3