public void Initialize(MyProducts_AdapterViewHolder holder, Get_Products_Object.Product item) { try { if (holder.Thumbnail.Tag?.ToString() != "loaded") { ImageServiceLoader.Load_Image(holder.Thumbnail, "ImagePlacholder.jpg", item.images[0].image, 2); holder.Thumbnail.Tag = "loaded"; } var AvatarSplit = item.seller.avatar.Split('/').Last(); var getImage_Avatar = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskImage, AvatarSplit); if (getImage_Avatar != "File Dont Exists") { if (holder.Userprofilepic.Tag?.ToString() != "loaded") { ImageServiceLoader.Load_Image(holder.Userprofilepic, "no_profile_image.png", getImage_Avatar, 1); holder.Userprofilepic.Tag = "loaded"; } } else { if (holder.Userprofilepic.Tag?.ToString() != "loaded") { IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskImage, item.seller.avatar); ImageServiceLoader.Load_Image(holder.Userprofilepic, "no_profile_image.png", item.seller.avatar, 1); holder.Userprofilepic.Tag = "loaded"; } } IMethods.Set_TextViewIcon("1", holder.mappinIcon, IonIcons_Fonts.IosLocation); holder.Txt_Title.Text = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(item.name)); string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(item.seller.name)); holder.User_name.Text = name; if (!string.IsNullOrEmpty(item.location)) { holder.LocationText.Text = item.location; } else { holder.LocationText.Text = Activity_Context.GetText(Resource.String.Lbl_Unknown); } holder.time.Text = item.time_text; holder.Txt_price.Text = item.price + " " + Settings.Market_curency; } catch (Exception e) { Crashes.TrackError(e); } }
// 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_Market_view, parent, false); var vh = new MyProducts_AdapterViewHolder(itemView, OnClick, OnLongClick); return(vh); } catch (Exception exception) { Crashes.TrackError(exception); return(null); } }