Example #1
0
        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)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Example #2
0
        public ArticlesCommentAdapterViewHolder(View itemView, string themeColor) : base(itemView)
        {
            try
            {
                MainView = itemView;

                BubbleLayout  = MainView.FindViewById <BubbleLinearLayout>(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 (themeColor != "Dark")
                {
                    return;
                }

                ReplyTextView.SetTextColor(Color.White);
                LikeTextView.SetTextColor(Color.White);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavBar.Title = $"Reply to #{_issueNumber}";
            NavBar.LeftBarButtonItem.Clicked += (sender, e) => Cancel();

            ReplyTextView.SelectAll(this);

            ReplyTextView.BecomeFirstResponder();
            var previewButton = NavBar.RightBarButtonItems
                                .FirstOrDefault(b => "Preview".Equals(b.Title));
            var doneButton = NavBar.RightBarButtonItems
                             .FirstOrDefault(b => !"Preview".Equals(b.Title));

            doneButton.Clicked += ReplyButtonClicked;

            previewButton.Clicked += (sender, e) =>
            {
                PerformSegue(StoryboardId.PreviewReplySegueIdentifier, this);
            };


            var notificationCenter = NSNotificationCenter.DefaultCenter;

            notificationCenter.AddObserver(UIKeyboard.WillChangeFrameNotification, AdjustForKeyboard);
            notificationCenter.AddObserver(UIKeyboard.WillHideNotification, AdjustForKeyboard);
        }
Example #4
0
        public CommentAdapterViewHolder(View itemView, string themeColor) : base(itemView)
        {
            try
            {
                MainView = itemView;

                BubbleLayout  = MainView.FindViewById <BubbleLinearLayout>(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);
                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.SetTabDarkTheme)
                {
                    ReplyTextView.SetTextColor(Color.White);
                    LikeTextView.SetTextColor(Color.White);
                }
                else
                {
                    ReplyTextView.SetTextColor(Color.Black);
                    LikeTextView.SetTextColor(Color.Black);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #5
0
        void AdjustForKeyboard(NSNotification notification)
        {
            var userInfo = notification.UserInfo;

            var keyboardScreenEndFrame = (userInfo[UIKeyboard.FrameEndUserInfoKey] as NSValue).CGRectValue;
            var keyboardViewEndFrame   = View.ConvertRectFromView(keyboardScreenEndFrame, View.Window);

            if (notification.Name == UIKeyboard.WillHideNotification)
            {
                ReplyTextView.ContentInset = UIEdgeInsets.Zero;
            }
            else
            {
                ReplyTextView.ContentInset = new UIEdgeInsets(0, 0, keyboardViewEndFrame.Height, 0);
            }

            ReplyTextView.ScrollIndicatorInsets = ReplyTextView.ContentInset;

            var selectedRange = ReplyTextView.SelectedRange;

            ReplyTextView.ScrollRangeToVisible(selectedRange);
        }
Example #6
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);
            }
        }