// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { try { //Setup your layout here >> Style_Article_View var itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Style_ArticleView, parent, false); var vh = new BlogAdapterViewHolder(itemView, OnClick, OnLongClick); return(vh); } catch (Exception exception) { Console.WriteLine(exception); return(null); } }
private void Initialize(BlogAdapterViewHolder holder, ArticleObject item) { try { GlideImageLoader.LoadImage(ActivityContext, !string.IsNullOrEmpty(item.Thumbnail) ? item.Thumbnail : "blackdefault", holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable); holder.Title.Text = Methods.FunString.DecodeString(item.Title); holder.Time.Text = item.CreatedAt; //holder.Category.Text = CategoriesController.GetCategoryName(item.Category, ""); //wael } catch (Exception e) { Console.WriteLine(e); } }