Beispiel #1
0
        public override void ViewDidLoad()
        {
            base.AreaCollectionOutlet       = AreaCollection;
            base.AreaCollectionHeightOutlet = AreaCollectionHeight;
            base.AreaCollectionTopOutlet    = cnsAreaCollectionTop;

            base.ViewDidLoad();

            ShouldDrillDownImmediately = true;

            var iv = new UIImageView(UIImage.FromBundle("more-bg.jpg"));

            iv.AddSubview(new UIView(iv.Bounds)
            {
                BackgroundColor = UIColor.FromRGBA(255, 255, 255, 128)
            });
            iv.ContentMode = UIViewContentMode.ScaleToFill;
            CollectionView.BackgroundView = iv;
            CollectionView.AddRefreshControl();
            AllRewardsButton.SetTitle("All Rewards");
            AvailableRewardsButton.SetTitle("Aviable");
            ClaimedButton.SetTitle("Claimed");

            // Perform any additional setup after loading the view, typically from a nib.
            CollectionView.RegisterNibForCell(RewardCollectionViewCell.Nib, RewardCollectionViewCell.ClassName);

            CheckToRegisterAppForRemoteNotifications();
        }
        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;
            }
        }
Beispiel #3
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);
        }
Beispiel #6
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();
        }
        void ReleaseDesignerOutlets()
        {
            if (AllRewardsButton != null)
            {
                AllRewardsButton.Dispose();
                AllRewardsButton = null;
            }

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

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

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

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

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

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

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

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

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