void ReleaseDesignerOutlets()
        {
            if (AllRewardsButton != null)
            {
                AllRewardsButton.Dispose();
                AllRewardsButton = null;
            }

            if (AviableRewardsButton != null)
            {
                AviableRewardsButton.Dispose();
                AviableRewardsButton = null;
            }

            if (ClaimedButton != null)
            {
                ClaimedButton.Dispose();
                ClaimedButton = null;
            }

            if (mainView != null)
            {
                mainView.Dispose();
                mainView = null;
            }

            if (tabBarView != null)
            {
                tabBarView.Dispose();
                tabBarView = null;
            }
        }
Example #2
0
 private void ChangeSelectedButton(int page)
 {
     UpdateTabButtons();
     if (page == 0)
     {
         AllRewardsButton.SetSelected();
     }
     if (page == 1)
     {
         AviableRewardsButton.SetSelected();
     }
     if (page == 2)
     {
         ClaimedButton.SetSelected();
     }
 }
        void ReleaseDesignerOutlets()
        {
            if (AllRewardsButton != null)
            {
                AllRewardsButton.Dispose();
                AllRewardsButton = null;
            }

            if (AreaCollection != null)
            {
                AreaCollection.Dispose();
                AreaCollection = null;
            }

            if (AreaCollectionHeight != null)
            {
                AreaCollectionHeight.Dispose();
                AreaCollectionHeight = null;
            }

            if (AviableRewardsButton != null)
            {
                AviableRewardsButton.Dispose();
                AviableRewardsButton = null;
            }

            if (ClaimedButton != null)
            {
                ClaimedButton.Dispose();
                ClaimedButton = null;
            }

            if (RewardsTableView != null)
            {
                RewardsTableView.Dispose();
                RewardsTableView = null;
            }

            if (tabBarView != null)
            {
                tabBarView.Dispose();
                tabBarView = null;
            }
        }
        //private bool _didReloadDataRewards;

        public override void ViewDidLoad()
        {
            tabBarView.Hidden               = true;
            base.AreaCollectionOutlet       = AreaCollection;
            base.AreaCollectionHeightOutlet = AreaCollectionHeight;

            base.ViewDidLoad();

            var iv = new UIImageView(UIImage.FromBundle("Background"));

            iv.ContentMode = UIViewContentMode.ScaleToFill;
            RewardsTableView.BackgroundView = iv;
            AllRewardsButton.SetTitle("All Rewards");
            AviableRewardsButton.SetTitle("Aviable");
            ClaimedButton.SetTitle("Claimed");

            // Perform any additional setup after loading the view, typically from a nib.
            RewardsTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            RewardsTableView.RegisterNibForCellReuse(MonthRewardsTableCell.Nib, MonthRewardsTableCell.Key);
            ChangeSelectedButton(CurrentPage);
        }
Example #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            tabBarView.Hidden = true;
            UIStoryboard board = UIStoryboard.FromName("Main", null);

            pageViewController = board.InstantiateViewController("PointsPageViewController") as UIPageViewController;
            pageSource         = new RewardsPageViewControllerDataSource(this);

            pageViewController.DataSource = pageSource;

            var startVC         = this.ViewControllerAtIndex(1) as RewardsBaseViewController; //start on second page for glitch (should start on page index 0 without glitch)
            var viewControllers = new UIViewController[] { startVC };

            pageViewController.SetViewControllers(viewControllers, UIPageViewControllerNavigationDirection.Forward, false, null);
            //pageViewController.View.Frame = new CGRect(0, 0, this.View.Frame.Width, this.View.Frame.Size.Height - 50);
            pageViewController.View.Frame = mainView.Frame;

            AddChildViewController(this.pageViewController);
            mainView.AddSubview(this.pageViewController.View);
            pageViewController.DidMoveToParentViewController(this);

            //startVC.ShowAreaCollection();
            //startVC.HideAreaCollection();
            //PrevPage();

            pageSource.ChangePage += (s, e) =>
            {
                var index = (int)s;
                ChangeSelectedButton(index);
            };
            AllRewardsButton.SetTitle("All Rewards");
            AviableRewardsButton.SetTitle("Aviable");
            ClaimedButton.SetTitle("Claimed");
            AllRewardsButton.SetSelected();
        }