Exemple #1
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);
            }
        }
        //Reply
        public CommentAdapterViewHolder(View itemView, ReplyCommentAdapter commentAdapter, CommentClickListener postClickListener) : base(itemView)
        {
            try
            {
                MainView = itemView;

                ReplyCommentAdapter = commentAdapter;
                PostClickListener   = postClickListener;
                TypeClass           = "Reply";

                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 || AppSettings.PostButton == PostButtonSystem.Like)
                {
                    LikeTextView.Visibility    = ViewStates.Gone;
                    DislikeTextView.Visibility = ViewStates.Gone;
                }

                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);
            }
        }