예제 #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_Group_Simple
         var itemView = LayoutInflater.From(parent.Context)
                        .Inflate(Resource.Layout.Style_Group_Simple, parent, false);
         var vh = new MyGroupsAdapterViewHolder(itemView, OnClick, OnLongClick);
         return(vh);
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
         return(null);
     }
 }
예제 #2
0
        public void Initialize(MyGroupsAdapterViewHolder holder, Get_User_Data_Object.Joined_Groups item)
        {
            try
            {
                var AvatarSplit     = item.avatar.Split('/').Last();
                var getImage_Avatar = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskGroup, AvatarSplit);
                if (getImage_Avatar != "File Dont Exists")
                {
                    if (holder.Image.Tag?.ToString() != "loaded")
                    {
                        ImageServiceLoader.Load_Image(holder.Image, "no_profile_image.png", item.avatar);
                        holder.Image.Tag = "loaded";
                    }
                }
                else
                {
                    if (holder.Image.Tag?.ToString() != "loaded")
                    {
                        IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskGroup, item.avatar);
                        ImageServiceLoader.Load_Image(holder.Image, "no_profile_image.png", item.avatar);
                        holder.Image.Tag = "loaded";
                    }
                }

                var CoverSplit     = item.cover.Split('/').Last();
                var getImage_Cover = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskGroup, CoverSplit);
                if (getImage_Cover == "File Dont Exists")
                {
                    IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskGroup, item.cover);
                }

                string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(item.name));
                holder.Nmae.Text = IMethods.Fun_String.SubStringCutOf(name, 20);
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }