public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.album_card, parent, false); var albumViewHolder = new AlbumViewHolder(itemView); _mainView = itemView; return(albumViewHolder); }
public override void OnBindViewHolder(RecyclerView.ViewHolder viewholder, int position) { var holder = new AlbumViewHolder(_mainView); var album = new Album { Name = _albumList[position].Name, Thumbnail = _albumList[position].Thumbnail, NumOfSongs = _albumList[position].NumOfSongs }; holder.Title.Text = album.Name; holder.Count.Text = album.NumOfSongs + " songs"; Picasso.With(_mContext).Load(album.Thumbnail).Into(holder.Thumbnail); holder.Overflow.Click += delegate { ShowPopupMenu(holder.Overflow); }; }