public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ShowHelpIfNecessary(TutorialHelper.Profiles);

            btnBack.TouchUpInside         += (sender, e) => NavigationController.PopViewController(true);
            feedController                 = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView      = vwHeader;
            feedController.Id              = UserId;
            feedController.Type            = FeedType.User;
            feedController.RefreshStarted += (sender, e) => GetData();
            AddChildViewController(feedController);
            View.Add(feedController.View);
            var f = feedController.View.Frame;

            f.X      = 0;
            f.Y      = 70;
            f.Width  = UIScreen.MainScreen.Bounds.Width;
            f.Height = UIScreen.MainScreen.Bounds.Height;
            feedController.View.Frame = f;
            feedController.HideAddPost();

            btnFollow.TouchUpInside += (sender, e) =>
            {
                if (profile == null)
                {
                    return;
                }
                Shared.Follower.ToggleFollow(btnFollow, profile, profile.UserId, FeedType.User, (following) =>
                {
                    GetData();
                });
            };
            Views.SetFollowed(btnFollow, false);

            lblFollowers.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (profile == null)
                {
                    return;
                }
                var controller  = Storyboard.InstantiateViewController <FollowersViewController>();
                controller.Id   = profile.UserId;
                controller.Type = FeedType.User;
                NavigationController.PushViewController(controller, true);
            }));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true);

            feedController                 = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView      = vwHeader;
            feedController.Type            = FeedType.Event;
            feedController.Id              = EventId;
            feedController.RefreshStarted += (sender, e) => GetData();
            AddChildViewController(feedController);
            View.Add(feedController.View);
            var f = feedController.View.Frame;

            f.X      = 0;
            f.Y      = 70;
            f.Width  = UIScreen.MainScreen.Bounds.Width;
            f.Height = UIScreen.MainScreen.Bounds.Height;
            feedController.View.Frame = f;
            feedController.HideAddPost();
            vwManyTeams.Hidden = true;
            GetData();

            btnShowTeams.TouchUpInside += (sender, e) =>
            {
                if (profile != null)
                {
                    var controller = Storyboard.InstantiateViewController <ShowTeamsViewController>();
                    controller.EventId = profile.Id;
                    NavigationController.PushViewController(controller, true);
                }
            };

            imgRight.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (profile != null && !string.IsNullOrEmpty(profile.TicketUrl))
                {
                    Links.OpenUrl(profile.TicketUrl);
                }
            }));
        }
Esempio n. 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true);

            feedController            = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView = null;
            feedController.Id         = PostId;
            feedController.Type       = FeedType.SinglePost;

            AddChildViewController(feedController);
            View.Add(feedController.View);
            var f = feedController.View.Frame;

            f.X      = 0;
            f.Y      = 70;
            f.Width  = UIScreen.MainScreen.Bounds.Width;
            f.Height = UIScreen.MainScreen.Bounds.Height;
            feedController.View.Frame = f;
            feedController.HideAddPost();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ShowHelpIfNecessary(TutorialHelper.Profiles);

            btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true);

            feedController                 = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView      = vwHeader;
            feedController.Id              = SportId;
            feedController.Type            = FeedType.Sport;
            feedController.RefreshStarted += (sender, e) => GetData();
            AddChildViewController(feedController);
            AddToScrollView(feedController.View, 0);
            feedController.HideAddPost();

            scoresController         = Storyboard.InstantiateViewController <ScoresViewController>();
            scoresController.SportId = SportId;
            AddToScrollView(scoresController.View, 1);
            scoresController.HideFilter();
            AddChildViewController(scoresController);

            rankingsController         = Storyboard.InstantiateViewController <SportRankingsViewController>();
            rankingsController.SportId = SportId;
            AddToScrollView(rankingsController.View, 2);
            AddChildViewController(rankingsController);

            aboutController         = Storyboard.InstantiateViewController <SportAboutViewController>();
            aboutController.SportId = SportId;
            AddToScrollView(aboutController.View, 3);
            AddChildViewController(aboutController);

            svScroller.ContentSize = new CoreGraphics.CGSize()
            {
                Width = UIScreen.MainScreen.Bounds.Width * 4
            };

            svScroller.Scrolled += (sender, e) =>
            {
                lcIndicatorLeading.Constant = svScroller.ContentOffset.X / 4f;
                int position = (int)(svScroller.ContentOffset.X / UIScreen.MainScreen.Bounds.Width);
                if (svScroller.ContentOffset.X % UIScreen.MainScreen.Bounds.Width > (UIScreen.MainScreen.Bounds.Width / 2f))
                {
                    position++;
                }

                if (position == 1)
                {
                    ShowHelpIfNecessary(TutorialHelper.SchedulesScores);
                }
            };

            GetData();

            btnProfile.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint(), true);
            };
            btnScores.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint()
                {
                    X = UIScreen.MainScreen.Bounds.Width
                }, true);
            };
            btnRankings.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint()
                {
                    X = UIScreen.MainScreen.Bounds.Width * 2
                }, true);
            };
            btnAbout.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint()
                {
                    X = UIScreen.MainScreen.Bounds.Width * 3
                }, true);
            };

            btnFollow.TouchUpInside += (sender, e) =>
            {
                if (profile == null)
                {
                    return;
                }

                Shared.Follower.ToggleFollow(btnFollow, profile, profile.Id, FeedType.Sport, (following) =>
                {
                    GetData();
                });
            };

            if (GoToRankings)
            {
                svScroller.SetContentOffset(new CGPoint()
                {
                    X = UIScreen.MainScreen.Bounds.Width * 2
                }, false);
            }

            lblFollowers.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (profile == null)
                {
                    return;
                }
                var controller  = Storyboard.InstantiateViewController <FollowersViewController>();
                controller.Id   = profile.Id;
                controller.Type = FeedType.Sport;
                NavigationController.PushViewController(controller, true);
            }));
        }
Esempio n. 5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            ShowHelpIfNecessary(TutorialHelper.Profiles, () =>
            {
                ShowHelpIfNecessary(TutorialHelper.ContentSource);
            });

            btnBack.TouchUpInside         += (sender, e) => NavigationController.PopViewController(true);
            feedController                 = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView      = vwHeader;
            feedController.Id              = ContentSourceId;
            feedController.Type            = FeedType.ContentSource;
            feedController.RefreshStarted += (sender, e) => GetData();
            AddChildViewController(feedController);
            svScroller.Add(feedController.View);
            var f = feedController.View.Frame;

            f.X      = 0;
            f.Y      = 0;
            f.Width  = UIScreen.MainScreen.Bounds.Width;
            f.Height = UIScreen.MainScreen.Bounds.Height - 120;
            feedController.View.Frame = f;
            feedController.HideAddPost();

            aboutController = Storyboard.InstantiateViewController <ContentSourceAboutViewController>();
            svScroller.Add(aboutController.View);
            var frame = aboutController.View.Frame;

            frame.X      = UIScreen.MainScreen.Bounds.Width;
            frame.Height = UIScreen.MainScreen.Bounds.Height - 120;
            frame.Width  = UIScreen.MainScreen.Bounds.Width;
            aboutController.View.Frame = frame;
            svScroller.ContentSize     = new CoreGraphics.CGSize()
            {
                Width = UIScreen.MainScreen.Bounds.Width * 2
            };

            svScroller.Scrolled += (sender, e) =>
            {
                lcIndicatorLeading.Constant = svScroller.ContentOffset.X / 2f;
            };

            GetData();

            btnProfile.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint(), true);
            };
            btnAbout.TouchUpInside += (sender, e) =>
            {
                svScroller.SetContentOffset(new CoreGraphics.CGPoint()
                {
                    X = UIScreen.MainScreen.Bounds.Width
                }, true);
            };

            btnFollow.TouchUpInside += (sender, e) =>
            {
                if (profile == null)
                {
                    return;
                }
                Shared.Follower.ToggleFollow(btnFollow, profile, profile.ContentSourceId, FeedType.ContentSource, (following) =>
                {
                    GetData();
                });
            };

            lblFollowers.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                if (profile == null)
                {
                    return;
                }
                var controller  = Storyboard.InstantiateViewController <FollowersViewController>();
                controller.Id   = profile.ContentSourceId;
                controller.Type = FeedType.ContentSource;
                NavigationController.PushViewController(controller, true);
            }));

            btnSignUp.TouchUpInside += (sender, e) =>
            {
                if (profile != null)
                {
                    Links.OpenUrl(profile.ActionButtonLink);
                }
            };
            lblUrl.UserInteractionEnabled = true;
            lblUrl.AddGestureRecognizer(new UITapGestureRecognizer((obj) =>
            {
                Links.OpenUrl(profile?.WebsiteLink);
            }));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ShowHelpIfNecessary(TutorialHelper.Profiles);

            btnBack.TouchUpInside += (sender, e) => NavigationController.PopViewController(true);

            feedController                 = Storyboard.InstantiateViewController <FeedViewController>();
            feedController.HeaderView      = vwHeader;
            feedController.Type            = FeedType.MyProfile;
            feedController.RefreshStarted += (sender, e) => GetProfileData();
            AddChildViewController(feedController);
            View.Add(feedController.View);
            var f = feedController.View.Frame;

            f.X      = 0;
            f.Y      = 70;
            f.Width  = UIScreen.MainScreen.Bounds.Width;
            f.Height = UIScreen.MainScreen.Bounds.Height - 70;
            feedController.View.Frame = f;

            var user = CrossSettings.Current.GetValueOrDefaultJson <User>("User");

            lblName.Text    = user.FirstName + " " + user.LastName;
            lblTitle.Text   = lblName.Text;
            lblAthlete.Text = "";
            if (string.IsNullOrEmpty(lblAthlete.Text))
            {
                lblAthlete.Superview.Hidden = true;
            }
            if (!string.IsNullOrEmpty(user.ProfileUrl))
            {
                ImageService.Instance.LoadUrl(user.ProfileUrl).Retry(3, 300).Transform(new CircleTransformation()).Into(imgProfile);
            }

            lblAthlete.Superview.Hidden = string.IsNullOrEmpty(user.AthleteTeamId);
            lblAthlete.Text             = user.AthleteSchool + " - " + user.AthleteSport;

            if (!user.AthleteVerified)
            {
                lblAthlete.Text             = "";
                lblAthlete.Superview.Hidden = true;
            }

            lblFollowers.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                var controller     = Storyboard.InstantiateViewController <FavoritesViewController>();
                controller.Page    = "Users";
                controller.SubPage = "Followers";
                NavigationController.PushViewController(controller, true);
            }));

            lblFollowing.Superview.AddGestureRecognizer(new UITapGestureRecognizer(() =>
            {
                var controller = Storyboard.InstantiateViewController <FavoritesViewController>();
                //controller.Page = "Users";
                NavigationController.PushViewController(controller, true);
            }));

            feedController.HideAddPost();

            GetProfileData();
        }