Example #1
0
        OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // Inflate the CardView for the photo:
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.MemberListItem, parent, false);

            GroupMemberListHolder vh = new GroupMemberListHolder(itemView, OnClick);



            return(vh);
        }
Example #2
0
        OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            GroupMemberListHolder vh = holder as GroupMemberListHolder;
            var item = originalContacts[position];

            if (item != null)
            {
                if (CommonHelper.GetUserId() == item.GroupMemberId)
                {
                    var CurrentUser = UserProfileRepository.GetUserProfile(CommonHelper.GetUserId());

                    if (CurrentUser != null)
                    {
                        vh.txtSenderName.Text = CurrentUser.FirstName + " " + CurrentUser.LastName;
                        if (!string.IsNullOrEmpty(CurrentUser.ProfileImageUrl))
                        {
                            CommonHelper.SetImageOnUIImageView(vh.contactPic, CurrentUser.ProfileImageUrl, Contextt, 400, 400);
                        }
                    }
                }

                else
                {
                    var memberProfile = Repositories.ContactRepository.GetContactbyUserId(Convert.ToInt32(item.GroupMemberId));
                    if (memberProfile != null)
                    {
                        vh.txtSenderName.Text = memberProfile.screenName;
                        if (!string.IsNullOrEmpty(memberProfile.contactPicUrl))
                        {
                            CommonHelper.SetImageOnUIImageView(vh.contactPic, memberProfile.contactPicUrl, Contextt, 400, 400);
                        }
                    }
                }
            }

            GroupMember addContactModel     = originalContacts[position];
            var         addContactListEvent = new GroupMemberListListner(addContactModel, Contextt);

            //  vh.AddContactButton.SetOnClickListener(addContactListEvent);
            addContactListEvent.ListReload += RefreshList;
        }