Ejemplo n.º 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_Video_View
         var itemView = LayoutInflater.From(parent.Context)
                        .Inflate(Resource.Layout.Style_Video_View, parent, false);
         var vh = new Movies_AdapterViewHolder(itemView, OnClick, OnLongClick);
         return(vh);
     }
     catch (Exception exception)
     {
         Crashes.TrackError(exception);
         return(null);
     }
 }
Ejemplo n.º 2
0
        public void Initialize(Movies_AdapterViewHolder holder, Get_Movies_Object.Movie movie)
        {
            try
            {
                var CoverSplit     = movie.cover.Split('/').Last();
                var getImage_Cover = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskMovie, CoverSplit);
                if (getImage_Cover != "File Dont Exists")
                {
                    if (holder.VideoImage.Tag?.ToString() != "loaded")
                    {
                        ImageServiceLoader.Load_Image(holder.VideoImage, "ImagePlacholder.jpg", getImage_Cover);
                        holder.VideoImage.Tag = "loaded";
                    }
                }
                else
                {
                    if (holder.VideoImage.Tag?.ToString() != "loaded")
                    {
                        IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskMovie, movie.cover);
                        ImageServiceLoader.Load_Image(holder.VideoImage, "ImagePlacholder.jpg", movie.cover);
                        holder.VideoImage.Tag = "loaded";
                    }
                }

                string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(movie.name));
                holder.Txt_Title.Text       = name;
                holder.Txt_Description.Text = IMethods.Fun_String.SubStringCutOf(movie.description, 50);
                holder.Txt_duration.Text    = movie.duration + " " + Activity_Context.GetText(Resource.String.Lbl_Min);
                holder.Txt_ViewsCount.Text  = movie.views + " " + Activity_Context.GetText(Resource.String.Lbl_Views);

                IMethods.Set_TextViewIcon("1", holder.MenueView, IonIcons_Fonts.AndroidMoreVertical);

                if (!holder.MenueView.HasOnClickListeners)
                {
                    holder.MenueView.Click += (sender, args) =>
                    {
                        try
                        {
                            var ctw   = new ContextThemeWrapper(Activity_Context, Resource.Style.PopupMenuStyle);
                            var popup = new PopupMenu(ctw, holder.MenueView);
                            popup.MenuInflater.Inflate(Resource.Menu.MoreCommunities_NotEdit_Menu, popup.Menu);
                            popup.Show();
                            popup.MenuItemClick += (o, eventArgs) =>
                            {
                                var Id = eventArgs.Item.ItemId;
                                switch (Id)
                                {
                                case Resource.Id.menu_CopeLink:
                                    OnCopeLink_Button_Click(movie);
                                    break;

                                case Resource.Id.menu_Share:
                                    OnShare_Button_Click(movie);
                                    break;
                                }
                            };
                        }
                        catch (Exception e)
                        {
                            Crashes.TrackError(e);
                        }
                    }
                }
                ;
            }
            catch (Exception e)
            {
                Crashes.TrackError(e);
            }
        }