// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { try { //Setup your layout here >> Style_Event_Cell var itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Style_Event_Cell, parent, false); var vh = new EventAdapterViewHolder(itemView, Click, LongClick); return(vh); } catch (Exception exception) { Console.WriteLine(exception); return(null); } }
private void Initialize(EventAdapterViewHolder holder, EventDataObject item) { try { GlideImageLoader.LoadImage(ActivityContext, item.Cover, holder.Image, ImageStyle.RoundedCrop, ImagePlaceholders.Color); holder.TxtEventTitle.SetTextFuture(PrecomputedTextCompat.GetTextFuture(Methods.FunString.DecodeString(item.Name), holder.TxtEventTitleTextMetrics, null)); holder.TxtEventDescription.SetTextFuture(PrecomputedTextCompat.GetTextFuture(Methods.FunString.DecodeString(item.Description), holder.TxtEventDescriptionTextMetrics, null)); holder.TxtEventLocation.SetTextFuture(PrecomputedTextCompat.GetTextFuture(item.Location, holder.TxtEventLocationTextMetrics, null)); holder.TxtEventTime.Text = item.EndDate; item.IsOwner = item.UserData.UserId == UserDetails.UserId; } catch (Exception e) { Console.WriteLine(e); } }