// Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is PlaylistAdapterViewHolder holder)
                {
                    var item = PlaylistList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.ThumbnailReady, holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                        holder.TxtName.Text = Methods.FunString.DecodeString(item.Name);

                        holder.TxtUserName.Text = item.Publisher != null?Methods.FunString.DecodeString(DeepSoundTools.GetNameFinal(item.Publisher.Value.PublisherClass)) : ActivityContext.GetText(Resource.String.Lbl_Unknown);

                        holder.TxtCountSongs.Text = item.Songs + " " + ActivityContext.GetText(Resource.String.Lbl_Songs);

                        holder.MoreButton.Visibility = ShowMore ? ViewStates.Visible : ViewStates.Gone;

                        if (!holder.MoreButton.HasOnClickListeners)
                        {
                            holder.MoreButton.Click += (sender, e) => LibrarySynchronizer.PlaylistMoreOnClick(new MorePlaylistClickEventArgs {
                                View = holder.MainView, PlaylistClass = item
                            });
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
示例#2
0
 private void IconMoreOnClick(object sender, EventArgs e)
 {
     try
     {
         LibrarySynchronizer?.PlaylistMoreOnClick(new MorePlaylistClickEventArgs()
         {
             PlaylistClass = PlaylistObject
         });
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }