public MoviesCommentAdapterViewHolder(View itemView, string themeColor) : base(itemView)
        {
            try
            {
                MainView = itemView;

                BubbleLayout  = MainView.FindViewById <LinearLayout>(Resource.Id.bubble_layout);
                Image         = MainView.FindViewById <CircleImageView>(Resource.Id.card_pro_pic);
                CommentText   = MainView.FindViewById <AutoLinkTextView>(Resource.Id.active);
                UserName      = MainView.FindViewById <TextView>(Resource.Id.username);
                TimeTextView  = MainView.FindViewById <TextView>(Resource.Id.time);
                ReplyTextView = MainView.FindViewById <TextView>(Resource.Id.reply);
                LikeTextView  = MainView.FindViewById <TextView>(Resource.Id.Like);

                var font = Typeface.CreateFromAsset(MainView.Context.Resources.Assets, "ionicons.ttf");
                UserName.SetTypeface(font, TypefaceStyle.Normal);

                if (AppSettings.FlowDirectionRightToLeft)
                {
                    BubbleLayout.SetBackgroundResource(Resource.Drawable.comment_rounded_right_layout);
                }

                if (themeColor != "Dark")
                {
                    return;
                }

                ReplyTextView.SetTextColor(Color.White);
                LikeTextView.SetTextColor(Color.White);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
        //Reply
        public CommentAdapterViewHolder(View itemView, ReplyCommentAdapter commentAdapter, CommentClickListener postClickListener, CommentObjectExtra commentObject = null) : base(itemView)
        {
            try
            {
                MainView = itemView;

                if (commentObject != null)
                {
                    ReplyCommentObject = commentObject;
                }
                ReplyCommentAdapter = commentAdapter;
                PostClickListener   = postClickListener;
                TypeClass           = "Reply";

                MainCommentLayout = MainView.FindViewById <RelativeLayout>(Resource.Id.mainComment);
                BubbleLayout      = MainView.FindViewById <LinearLayout>(Resource.Id.bubble_layout);
                Image             = MainView.FindViewById <CircleImageView>(Resource.Id.card_pro_pic);
                CommentText       = MainView.FindViewById <SuperTextView>(Resource.Id.active);
                CommentText?.SetTextInfo(CommentText);

                UserName                    = MainView.FindViewById <TextView>(Resource.Id.username);
                TimeTextView                = MainView.FindViewById <TextView>(Resource.Id.time);
                ReplyTextView               = MainView.FindViewById <TextView>(Resource.Id.reply);
                LikeTextView                = MainView.FindViewById <TextView>(Resource.Id.Like);
                DislikeTextView             = MainView.FindViewById <TextView>(Resource.Id.dislike);
                CommentImage                = MainView.FindViewById <ImageView>(Resource.Id.image);
                CountLikeSection            = MainView.FindViewById <LinearLayout>(Resource.Id.countLikeSection);
                CountLike                   = MainView.FindViewById <TextView>(Resource.Id.countLike);
                ImageCountLike              = MainView.FindViewById <ImageView>(Resource.Id.ImagecountLike);
                CountLikeSection.Visibility = ViewStates.Gone;
                RatingBar                   = itemView.FindViewById <RatingBar>(Resource.Id.RatingBar);
                RatingText                  = itemView.FindViewById <Button>(Resource.Id.RatingText);
                RatingLinearLayout          = itemView.FindViewById <LinearLayout>(Resource.Id.RatingLinearLayout);
                CountRating                 = MainView.FindViewById <TextView>(Resource.Id.countRating);
                try
                {
                    VoiceLayout   = MainView.FindViewById <LinearLayout>(Resource.Id.voiceLayout);
                    PlayButton    = MainView.FindViewById <CircleButton>(Resource.Id.playButton);
                    DurationVoice = MainView.FindViewById <TextView>(Resource.Id.Duration);
                    TimeVoice     = MainView.FindViewById <TextView>(Resource.Id.timeVoice);

                    PlayButton?.SetOnClickListener(this);
                }
                catch (Exception e)
                {
                    Methods.DisplayReportResultTrack(e);
                }

                var font = Typeface.CreateFromAsset(MainView.Context.Resources?.Assets, "ionicons.ttf");
                UserName.SetTypeface(font, TypefaceStyle.Normal);

                if (AppSettings.FlowDirectionRightToLeft)
                {
                    BubbleLayout.SetBackgroundResource(Resource.Drawable.comment_rounded_right_layout);
                }

                if (AppSettings.PostButton == PostButtonSystem.DisLike || AppSettings.PostButton == PostButtonSystem.Wonder)
                {
                    DislikeTextView.Visibility = ViewStates.Visible;
                }

                ReplyTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                LikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                DislikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                MainView.SetOnLongClickListener(this);
                Image.SetOnClickListener(this);
                LikeTextView.SetOnClickListener(this);
                DislikeTextView.SetOnClickListener(this);
                ReplyTextView.SetOnClickListener(this);
                CommentImage?.SetOnClickListener(this);
                CountLikeSection?.SetOnClickListener(this);
                RatingLinearLayout?.SetOnClickListener(this);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        //Comment
        public CommentAdapterViewHolder(View itemView, CommentAdapter commentAdapter, CommentClickListener postClickListener, string typeClass = "Comment") : base(itemView)
        {
            try
            {
                MainView = itemView;

                CommentAdapter    = commentAdapter;
                PostClickListener = postClickListener;
                TypeClass         = typeClass;

                MainCommentLayout = MainView.FindViewById <RelativeLayout>(Resource.Id.mainComment);
                BubbleLayout      = MainView.FindViewById <LinearLayout>(Resource.Id.bubble_layout);
                Image             = MainView.FindViewById <CircleImageView>(Resource.Id.card_pro_pic);
                CommentText       = MainView.FindViewById <SuperTextView>(Resource.Id.active);
                CommentText?.SetTextInfo(CommentText);

                UserName                    = MainView.FindViewById <TextView>(Resource.Id.username);
                TimeTextView                = MainView.FindViewById <TextView>(Resource.Id.time);
                ReplyTextView               = MainView.FindViewById <TextView>(Resource.Id.reply);
                LikeTextView                = MainView.FindViewById <TextView>(Resource.Id.Like);
                DislikeTextView             = MainView.FindViewById <TextView>(Resource.Id.dislike);
                CommentImage                = MainView.FindViewById <ImageView>(Resource.Id.image);
                CountLikeSection            = MainView.FindViewById <LinearLayout>(Resource.Id.countLikeSection);
                CountLike                   = MainView.FindViewById <TextView>(Resource.Id.countLike);
                ImageCountLike              = MainView.FindViewById <ImageView>(Resource.Id.ImagecountLike);
                CountLikeSection.Visibility = ViewStates.Gone;
                try
                {
                    VoiceLayout   = MainView.FindViewById <LinearLayout>(Resource.Id.voiceLayout);
                    PlayButton    = MainView.FindViewById <CircleButton>(Resource.Id.playButton);
                    DurationVoice = MainView.FindViewById <TextView>(Resource.Id.Duration);
                    TimeVoice     = MainView.FindViewById <TextView>(Resource.Id.timeVoice);

                    PlayButton?.SetOnClickListener(this);
                }
                catch (Exception e)
                {
                    Methods.DisplayReportResultTrack(e);
                }

                var font = Typeface.CreateFromAsset(MainView.Context.Resources?.Assets, "ionicons.ttf");
                UserName.SetTypeface(font, TypefaceStyle.Normal);

                switch (AppSettings.FlowDirectionRightToLeft)
                {
                case true:
                    BubbleLayout.SetBackgroundResource(Resource.Drawable.comment_rounded_right_layout);
                    break;
                }

                switch (AppSettings.PostButton)
                {
                case PostButtonSystem.DisLike:
                case PostButtonSystem.Wonder:
                    DislikeTextView.Visibility = ViewStates.Visible;
                    break;
                }

                /*ReplyTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                 * LikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                 * DislikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);*/
                ReplyTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.ParseColor("#888888"));
                LikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.ParseColor("#888888"));
                DislikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.ParseColor("#888888"));

                MainView.SetOnLongClickListener(this);
                Image.SetOnClickListener(this);
                LikeTextView.SetOnClickListener(this);
                DislikeTextView.SetOnClickListener(this);
                ReplyTextView.SetOnClickListener(this);
                CommentImage?.SetOnClickListener(this);
                CountLikeSection?.SetOnClickListener(this);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        //Comment
        public CommentAdapterViewHolder(View itemView, CommentAdapter commentAdapter, CommentClickListener postClickListener, string typeClass = "Comment") : base(itemView)
        {
            try
            {
                MainView = itemView;

                CommentAdapter    = commentAdapter;
                PostClickListener = postClickListener;
                TypeClass         = typeClass;

                BubbleLayout    = MainView.FindViewById <LinearLayout>(Resource.Id.bubble_layout);
                Image           = MainView.FindViewById <CircleImageView>(Resource.Id.card_pro_pic);
                CommentText     = MainView.FindViewById <AutoLinkTextView>(Resource.Id.active);
                UserName        = MainView.FindViewById <TextView>(Resource.Id.username);
                TimeTextView    = MainView.FindViewById <TextView>(Resource.Id.time);
                ReplyTextView   = MainView.FindViewById <TextView>(Resource.Id.reply);
                LikeTextView    = MainView.FindViewById <TextView>(Resource.Id.Like);
                DislikeTextView = MainView.FindViewById <TextView>(Resource.Id.dislike);
                CommentImage    = MainView.FindViewById <ImageView>(Resource.Id.image);

                try
                {
                    VoiceLayout   = MainView.FindViewById <LinearLayout>(Resource.Id.voiceLayout);
                    PlayButton    = MainView.FindViewById <CircleButton>(Resource.Id.playButton);
                    DurationVoice = MainView.FindViewById <TextView>(Resource.Id.Duration);
                    TimeVoice     = MainView.FindViewById <TextView>(Resource.Id.timeVoice);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }

                var font = Typeface.CreateFromAsset(MainView.Context.Resources.Assets, "ionicons.ttf");
                UserName.SetTypeface(font, TypefaceStyle.Normal);

                if (AppSettings.FlowDirectionRightToLeft)
                {
                    BubbleLayout.SetBackgroundResource(Resource.Drawable.comment_rounded_right_layout);
                }

                if (AppSettings.PostButton == PostButtonSystem.DisLike || AppSettings.PostButton == PostButtonSystem.Wonder)
                {
                    DislikeTextView.Visibility = ViewStates.Visible;
                }

                ReplyTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                LikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                DislikeTextView.SetTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);

                MainView.SetOnLongClickListener(this);
                Image.SetOnClickListener(this);
                LikeTextView.SetOnClickListener(this);
                DislikeTextView.SetOnClickListener(this);
                ReplyTextView.SetOnClickListener(this);
                CommentImage?.SetOnClickListener(this);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }