コード例 #1
0
 // Create new views (invoked by the layout manager)
 public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
 {
     try
     {
         //Setup your layout here >> Style_PageCircle_view
         var itemView = LayoutInflater.From(parent.Context)
                        .Inflate(Resource.Layout.Style_PageCircle_view, parent, false);
         var vh = new MyPagesAdapterViewHolder(itemView, OnClick, OnLongClick);
         return(vh);
     }
     catch (Exception e)
     {
         Crashes.TrackError(e);
         return(null);
     }
 }
コード例 #2
0
        public void Initialize(MyPagesAdapterViewHolder holder, Get_User_Data_Object.Liked_Pages item)
        {
            try
            {
                var AvatarSplit     = item.avatar.Split('/').Last();
                var getImage_Avatar = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskPage, AvatarSplit);
                if (getImage_Avatar != "File Dont Exists")
                {
                    if (holder.Image.Tag?.ToString() != "loaded")
                    {
                        ImageServiceLoader.Load_Image(holder.Image, "ImagePlacholder.jpg", getImage_Avatar, 1);
                        holder.Image.Tag = "loaded";
                    }
                }
                else
                {
                    if (holder.Image.Tag?.ToString() != "loaded")
                    {
                        IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskPage, item.avatar);
                        ImageServiceLoader.Load_Image(holder.Image, "ImagePlacholder.jpg", item.avatar, 1);
                        holder.Image.Tag = "loaded";
                    }
                }

                var CoverSplit     = item.cover.Split('/').Last();
                var getImage_Cover = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskPage, CoverSplit);
                if (getImage_Cover != "File Dont Exists")
                {
                    //ImageServiceLoader.Load_Image(holder.Image, "ImagePlacholder.jpg", getImage_Cover);
                }
                else
                {
                    IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskPage, item.cover);
                    // ImageServiceLoader.Load_Image(holder.Image, "ImagePlacholder.jpg", result.user_data.cover);
                }

                string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(item.page_name));
                holder.Name.Text = name;
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }