Exemplo n.º 1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.reddit_item, parent, false);

            SubRedditViewHolder subRedditViewHolder = new SubRedditViewHolder(itemView);

            return(subRedditViewHolder);
        }
Exemplo n.º 2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            SubRedditViewHolder vh = holder as SubRedditViewHolder;

            vh.Name.Text = mListSubRedditChildren[position].data.display_name_prefixed;

            String imageSubRedditUrl = mListSubRedditChildren[position].data.icon_img;

            if (!String.IsNullOrEmpty(imageSubRedditUrl))
            {
                imageLoader = ImageLoader.Instance;
                imageLoader.DisplayImage(imageSubRedditUrl, vh.ImageViewSubReddit);
            }

            vh.ItemView.Click += (sender, e) => onClickListener(position, mListSubRedditChildren[position].data.display_name_prefixed);
        }