예제 #1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // Inflate the CardView for the photo:
            View playlistView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Playlist_Cell, parent, false);

            PlaylistViewHolder holder = new PlaylistViewHolder(playlistView, PlaylistSelected);

            return(holder);
        }
예제 #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            PlaylistViewHolder viewHolder = holder as PlaylistViewHolder;

            Playlist currentPlaylist = playlists[position] as Playlist;

            // Load the photo image resource from the photo album:
            var bitmap = GetImageBitmapFromUrl(currentPlaylist.Image);

            // Set data to cells //
            viewHolder.PlaylistImage.SetImageBitmap(bitmap);
            viewHolder.PlaylistTitle.Text   = currentPlaylist.Name;
            viewHolder.PlaylistCreator.Text = "Created by " + currentPlaylist.OwnerID;
        }