Exemplo n.º 1
0
        //Using the LayoutManager, fills the contents of the photo card
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            PhotoViewHolder vh = holder as PhotoViewHolder;

            // Load the photo image resource from the photo album:
            vh.Image.SetImageResource(mPhotoAlbum[position].PhotoID);
            // Load the photo caption from the photo album:
            vh.Caption.Text = mPhotoAlbum[position].Caption;
        }
Exemplo n.º 2
0
        //Using the LayoutManager, Creates a new photo in the CardView
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            //Inflates the CardView for the photo
            View itemView = LayoutInflater.From(parent.Context).
                            Inflate(Resource.Layout.PhotoCardView, parent, false);
            //Create a ViewHolder to find and hold these view references
            PhotoViewHolder vh = new PhotoViewHolder(itemView);

            return(vh);
        }