Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            profile_image.Layer.BorderColor = UIColor.White.CGColor;

            profile_image.Layer.BorderWidth = 4f;

            edit_profile.Layer.BorderColor = UIColor.White.CGColor;

            edit_profile.Layer.BorderWidth = 2f;

            header_view.BackgroundColor = UIColor.FromRGB(75, 171, 229);

            edit_profile.TouchUpInside += delegate
            {
                ViewModel.ShowProfile();
            };

            var ShowBubble1 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[0].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[0].name;

                        selected_bubble = ViewModel.Profile_bubbles[0];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            //this.HidesBottomBarWhenPushed = true;
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 01");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 01");
                }
            });

            var ShowBubble2 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[1].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[1].name;

                        selected_bubble = ViewModel.Profile_bubbles[1];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 02");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 02");
                }
            });

            var ShowBubble3 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[2].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[2].name;

                        selected_bubble = ViewModel.Profile_bubbles[2];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 03");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 03");
                }
            });

            var ShowBubble4 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[3].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[3].name;

                        selected_bubble = ViewModel.Profile_bubbles[3];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }

                    else
                    {
                        Console.WriteLine("Add bubble 04");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 04");
                }
            });

            var ShowBubble5 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[4].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[4].name;

                        selected_bubble = ViewModel.Profile_bubbles[4];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 05");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 05");
                }
            });

            var ShowBubble6 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[5].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[5].name;

                        selected_bubble = ViewModel.Profile_bubbles[5];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 06");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 06");
                }
            });

            var ShowBubble7 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[6].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[6].name;

                        selected_bubble = ViewModel.Profile_bubbles[6];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 07");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 07");
                }
            });

            var ShowBubble8 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[7].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[7].name;

                        selected_bubble = ViewModel.Profile_bubbles[7];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 08");
                    }
                }
                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 08");
                }
            });

            var ShowBubble9 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[8].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[8].name;

                        selected_bubble = ViewModel.Profile_bubbles[8];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);

                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 09");
                    }
                }

                catch (Exception ex)
                {
                    ViewModel.ShowBubbleBoard();
                    Console.WriteLine("Add bubble 09");
                }
            });

            var ShowBubble10 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[9].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[9].name;

                        selected_bubble = ViewModel.Profile_bubbles[9];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                    else
                    {
                        Console.WriteLine("Add bubble 10");
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Add bubble 10");
                }
            });

            bubble_01.AddGestureRecognizer(ShowBubble1);
            bubble_02.AddGestureRecognizer(ShowBubble2);
            bubble_03.AddGestureRecognizer(ShowBubble3);
            bubble_04.AddGestureRecognizer(ShowBubble4);
            bubble_05.AddGestureRecognizer(ShowBubble5);
            bubble_06.AddGestureRecognizer(ShowBubble6);
            bubble_07.AddGestureRecognizer(ShowBubble7);
            bubble_08.AddGestureRecognizer(ShowBubble8);
            bubble_09.AddGestureRecognizer(ShowBubble9);
            bubble_01.UserInteractionEnabled = true;
            bubble_02.UserInteractionEnabled = true;
            bubble_03.UserInteractionEnabled = true;
            bubble_04.UserInteractionEnabled = true;
            bubble_05.UserInteractionEnabled = true;
            bubble_06.UserInteractionEnabled = true;
            bubble_07.UserInteractionEnabled = true;
            bubble_08.UserInteractionEnabled = true;
            bubble_09.UserInteractionEnabled = true;


            //bubble_10.AddGestureRecognizer(ShowBubble10);
        }
Пример #2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            AccountInfo.first_profile_id = null;

            AccountInfo.first_profile_image = null;

            Console.WriteLine(this.View.Frame.Height);

            var ShowBubble1 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[0].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[0].name;

                        selected_bubble = ViewModel.Profile_bubbles[0];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            //this.HidesBottomBarWhenPushed = true;
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble2 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[1].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[1].name;

                        selected_bubble = ViewModel.Profile_bubbles[1];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble3 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[2].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[2].name;

                        selected_bubble = ViewModel.Profile_bubbles[2];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble4 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[3].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[3].name;

                        selected_bubble = ViewModel.Profile_bubbles[3];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble5 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[4].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[4].name;

                        selected_bubble = ViewModel.Profile_bubbles[4];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble6 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[5].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[5].name;

                        selected_bubble = ViewModel.Profile_bubbles[5];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble7 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[6].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[6].name;

                        selected_bubble = ViewModel.Profile_bubbles[6];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble8 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[7].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[7].name;

                        selected_bubble = ViewModel.Profile_bubbles[7];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            var ShowBubble9 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[8].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[8].name;

                        selected_bubble = ViewModel.Profile_bubbles[8];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);

                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }

                catch (Exception ex)
                {
                }
            });

            var ShowBubble10 = new UITapGestureRecognizer(() =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[9].name))
                    {
                        //bubble_name = ViewModel.Profile_bubbles[9].name;

                        selected_bubble = ViewModel.Profile_bubbles[9];

                        var popup_size = new CoreGraphics.CGSize(this.View.Frame.Width - 20, 300);

                        CustomPopup cpuv = new CustomPopup(popup_size, selected_bubble);
                        cpuv.PopUp(true, delegate
                        {
                            Console.WriteLine("cpuv will close");
                        });
                    }
                }
                catch (Exception ex)
                {
                }
            });

            bubble_01.AddGestureRecognizer(ShowBubble1);
            bubble_02.AddGestureRecognizer(ShowBubble2);
            bubble_03.AddGestureRecognizer(ShowBubble3);
            bubble_04.AddGestureRecognizer(ShowBubble4);
            bubble_05.AddGestureRecognizer(ShowBubble5);
            bubble_06.AddGestureRecognizer(ShowBubble6);
            bubble_07.AddGestureRecognizer(ShowBubble7);
            bubble_08.AddGestureRecognizer(ShowBubble8);
            bubble_09.AddGestureRecognizer(ShowBubble9);
            bubble_10.AddGestureRecognizer(ShowBubble10);



            this.NavigationController.NavigationBarHidden = false;

            ViewModel.GetProfilesDetails();

            this.View.BackgroundColor = UIColor.FromRGB(246, 194, 96);

            var bubble01Height = bubble_01.HeightAnchor.ConstraintEqualTo(0);

            bubble01Height.Active = true;

            var bubble05Height = bubble_05.HeightAnchor.ConstraintEqualTo(0);

            bubble05Height.Active = true;

            var bubble08Height = bubble_08.HeightAnchor.ConstraintEqualTo(0);

            bubble08Height.Active = true;

            ViewModel.ForPropertyChange(x => x.UserName, y =>
            {
                profile_name.AttributedText = new NSAttributedString(ViewModel.profile_name + "," + ViewModel.profile_age, underlineStyle: NSUnderlineStyle.None);

                try
                {
                    if (!string.IsNullOrEmpty(ViewModel.image_url))
                    {
                        profile_image.Image = FromUrl(ViewModel.image_url);
                    }

                    else
                    {
                        profile_image.Image = FromUrl("https://srendip-dev.s3.amazonaws.com/no-image-icon.png");
                    }
                }
                catch (Exception ex)
                {
                }
            });

            ViewModel.ForPropertyChange(x => x.Profile_bubbles, y =>
            {
                for (int a = 0; a < ViewModel.Profile_bubbles.Count; a++)
                {
                    if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(0))
                    {
                        bubble_01.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_01.Hidden      = false;
                        bubble01Height.Active = false;

                        bubble_01.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(1))
                    {
                        bubble_02.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_02.Hidden = false;

                        bubble_02.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(2))
                    {
                        bubble_03.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_03.Hidden = false;



                        bubble_03.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(3))
                    {
                        bubble_04.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_04.Hidden = false;



                        bubble_04.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(4))
                    {
                        bubble_05.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_05.Hidden = false;

                        bubble05Height.Active = false;



                        bubble_05.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(5))
                    {
                        bubble_06.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_06.Hidden = false;



                        bubble_06.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(6))
                    {
                        bubble_07.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_07.Hidden = false;



                        bubble_07.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(7))
                    {
                        bubble_08.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_08.Hidden = false;

                        bubble08Height.Active = false;



                        bubble_08.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(8))
                    {
                        bubble_09.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_09.Hidden = false;



                        bubble_09.UserInteractionEnabled = true;
                    }

                    else if (!string.IsNullOrEmpty(ViewModel.Profile_bubbles[a].icon) && a.Equals(9))
                    {
                        bubble_10.Image = FromUrl(ViewModel.Profile_bubbles[a].icon);

                        bubble_10.Hidden = false;



                        bubble_10.UserInteractionEnabled = true;
                    }
                }
            });

            NavigationBarSetUp();
        }