Exemple #1
0
        public void Initialize(GroupsAdapterViewHolder holder, Get_Community_Object.Group 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", getImage_Avatar, 1);
                        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, 1);
                        holder.Image.Tag = "loaded";
                    }
                }

                IMethods.Set_TextViewIcon("1", holder.IconGroup, IonIcons_Fonts.PersonStalker);

                string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(item.GroupName));
                holder.Name.Text = IMethods.Fun_String.SubStringCutOf(name, 14);
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }
Exemple #2
0
 // Create new views (invoked by the layout manager)
 public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
 {
     try
     {
         //Setup your layout here >> Style_GroupCircle_view
         var itemView = LayoutInflater.From(parent.Context)
                        .Inflate(Resource.Layout.Style_GroupCircle_view, parent, false);
         var vh = new GroupsAdapterViewHolder(itemView, OnClick, OnLongClick);
         return(vh);
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
         return(null);
     }
 }