Ejemplo n.º 1
0
        public void DisplayData(string fullname, string description, string avatar, string time, string videofile, int likesCount, bool isliked, bool isSaved, int votesCount)
        {
            try
            {
                Fullname.Text     = fullname;
                TimeTextView.Text = time;
                GlideImageLoader.LoadImage(Activity, avatar, UserAvatar, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                var textSanitizer = new TextSanitizer(Description, Activity);
                if (!string.IsNullOrEmpty(description))
                {
                    ReadMoreOption.AddReadMoreTo(Description, Methods.FunString.DecodeString(description));
                    textSanitizer.Load(Methods.FunString.DecodeString(description));
                }
                else
                {
                    Description.Visibility = ViewStates.Gone;
                }
                CommentIcon.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#888888") : Color.ParseColor("#444444"));
                LikeCount.Text = likesCount + " " + Context.GetText(Resource.String.Lbl_Likes);
                LikeIcon.Tag   = "Like";

                if (isliked)
                {
                    LikeIcon.SetTextColor(Color.ParseColor("#ed4856"));
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, LikeIcon, IonIconsFonts.IosHeart);
                    LikeIcon.Tag = "Liked";
                }

                if (!isSaved)
                {
                    Favicon.SetTextColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#888888") : Color.ParseColor("#444444"));
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, Favicon, IonIconsFonts.IosStarOutline);
                    Favicon.Tag = "Add";
                }
                else
                {
                    Favicon.SetTextColor(Color.ParseColor("#FFCE00"));
                    FontUtils.SetTextViewIcon(FontsIconFrameWork.IonIcons, Favicon, IonIconsFonts.AndroidStar);
                    Favicon.Tag = "Added";
                }

                CommentCount.Text = votesCount + " " + Context.GetText(Resource.String.Lbl_Comments);

                if (votesCount <= 4)
                {
                    ViewCommentsButton.Visibility = ViewStates.Gone;
                }
                else
                {
                    ViewCommentsButton.Click += ViewcommentsButton_Click;
                }

                VideoProgressBar.Visibility = ViewStates.Visible;
                VideoActionsController      = new VideoController(Mainview, "Viewer_Video");
                if (VideoActionsController.Player == null)
                {
                    VideoActionsController?.PlayVideo(videofile);
                }

                VideoActionsController.Player.PlayWhenReady = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
 public AdMediaSourceFactory(VideoController activity)
 {
     Activity = activity;
 }