// Replace the contents of a view (invoked by the layout manager) public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { DocumentModel docModel = docList[position]; var viewHolder = holder as AdapterMyDocumentViewHolder; viewHolder.tvDocTitle.Text = docModel.DocumentTitle; AdapterMyDocumentViewHolder.SetDocIconAndColor(Convert.ToString(docModel.DocumentType), viewHolder.imgViewDocumentIcon, viewHolder.linearLayoutRandomColor); }
// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { View itemView = null; var DocumentLayoutId = Resource.Layout.row_mydocument; itemView = LayoutInflater.From(parent.Context).Inflate(DocumentLayoutId, parent, false); var viewholder = new AdapterMyDocumentViewHolder(itemView); return(viewholder); }