示例#1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView             = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.ConversationItemRovView, parent, false);
            ConversationViewHolder vh = new ConversationViewHolder(itemView, OnConversationItemClick);

            return(vh);
        }
示例#2
0
        public override async void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            var currentItem           = this.ConversationItems[position];
            ConversationViewHolder vh = holder as ConversationViewHolder;

            vh.InterlocutorNameTextView.Text = currentItem.InterlocutorName;
            vh.LastMessageTextView.Text      = currentItem.LastMessage;
            vh.LastMessageDateTextView.Text  = currentItem.LastMessageDate;
            if (currentItem.InterLocutorProfileImage != null)
            {
                vh.InterlocutorProfileImage.SetImageBitmap(await this.bitmapService.GetScaledDownBitmapForDisplayAsync(currentItem.InterLocutorProfileImage));
            }
            else
            {
                vh.InterlocutorProfileImage.SetImageResource(Resource.Drawable.logo_user);
            }
            vh.LastMessageDateTextView.Text = currentItem.LastMessageDate;

            RaiseOnInfiniteScrollWhenItemIsLastInList(currentItem, vh);
        }
示例#3
0
 private void RaiseOnInfiniteScrollWhenItemIsLastInList(ConversationItemModel currentItem, ConversationViewHolder viewHolder)
 {
     if (this.ConversationItems.IndexOf(currentItem) == (this.ConversationItems.Count - 1) && !InfiniteScrollDisabled)
     {
         this.infiniteScrollListener.OnInfiniteScroll();
     }
 }