Пример #1
0
        void Register_TouchUpInside(object sender, EventArgs e)
        {
            FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(this));

            this.ShowViewController(new UINavigationController(favClassificationsVC), this);
            DismissModalViewController(true);
        }
        public List <IMultiStepProcessStep> GetSteps()
        {
            GridLayout classificationsGridLayout = new GridLayout();

            int classificationItemWidth  = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 200 : 100;
            int classificationItemHeight = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 150 : 100;

            classificationsGridLayout.ItemSize = new CoreGraphics.CGSize(classificationItemWidth, classificationItemHeight);

            int insetTop             = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 125 : 75;
            int insetLeftBottomRight = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 50 : 5;

            classificationsGridLayout.SectionInset        = new UIEdgeInsets(insetTop, insetLeftBottomRight, insetLeftBottomRight, insetLeftBottomRight);
            classificationsGridLayout.HeaderReferenceSize = new CoreGraphics.CGSize(UIScreen.MainScreen.Bounds.Width - 100, 0);

            FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(classificationsGridLayout);

            favClassificationsVC.CollectionView.BackgroundView          = new UIImageView(UIImage.FromBundle("new_home_bg1"));
            favClassificationsVC.CollectionView.AllowsMultipleSelection = true;

            //RegistrationProfileViewController myInterestsVC = this.Storyboard.InstantiateViewController("MyProfileViewController") as RegistrationProfileViewController;

            MainRegistrationViewController mainRegistrationVC = UIStoryboard.FromName(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ?"Registration_ipad":"Registration", null).InstantiateViewController("MainRegistrationViewController") as MainRegistrationViewController;

            Page2RegistrationViewController page2RegistrationVC = UIStoryboard.FromName(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ?"Registration_ipad":"Registration", null).InstantiateViewController("Page2RegistrationViewController") as Page2RegistrationViewController;

            Page3RegistrationViewController page3RegistrationVC = UIStoryboard.FromName(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ?"Registration_ipad":"Registration", null).InstantiateViewController("Page3RegistrationViewController") as Page3RegistrationViewController;

            var steps = new List <IMultiStepProcessStep>()
            {
                //favClassificationsVC,
                //myInterestsVC
                mainRegistrationVC,
                page2RegistrationVC,
                page3RegistrationVC
            };



            steps.ForEach(s =>
            {
                s.StepActivated   += HandleStepActivated;
                s.StepDeactivated += HandleStepDeactivated;
            });

            return(steps);
        }
Пример #3
0
        public static void LikeRegistrationRequiredPrompt(UIViewController viewController, UIButton button)
        {
            var alert = UIAlertController.Create("The Like feature requires registration", "This feature will allow you to “Like” your favorite aircraft and write notes.\nWould you like to register now?", UIAlertControllerStyle.ActionSheet);

            alert.AddAction(UIAlertAction.Create("Not Yet", UIAlertActionStyle.Default, null));

            alert.AddAction(UIAlertAction.Create("Register Now", UIAlertActionStyle.Default,
                                                 (action) =>
            {
                FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(viewController));

                viewController.ShowViewController(new UINavigationController(favClassificationsVC), viewController);
            }));



            if (alert.PopoverPresentationController != null)
            {
                alert.PopoverPresentationController.SourceView = button;
                alert.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Up;
            }
            viewController.PresentViewController(alert, animated: true, completionHandler: null);
        }
Пример #4
0
        public static void SellerRegistrationRequiredSmallPrompt(UIViewController viewController, UIButton button)
        {
            var alert = UIAlertController.Create("The Order by feature requires registration", "This feature will order the inventory a seller has (example: All of the listings Jetcraft has). Would you like to register now?", UIAlertControllerStyle.ActionSheet);

            alert.AddAction(UIAlertAction.Create("Not Yet", UIAlertActionStyle.Default, null));

            alert.AddAction(UIAlertAction.Create("Register Now", UIAlertActionStyle.Default,
                                                 (action) =>
            {
                FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(viewController));

                viewController.ShowViewController(new UINavigationController(favClassificationsVC), viewController);
            }));



            if (alert.PopoverPresentationController != null)
            {
                alert.PopoverPresentationController.SourceView = button;
                alert.PopoverPresentationController.PermittedArrowDirections = UIPopoverArrowDirection.Any;
            }
            viewController.PresentViewController(alert, animated: true, completionHandler: null);
        }
        public BetterExperienceOverlay(CGRect frame) : base(frame)
        {
            int fontSizeForSolicitLabel   = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 18 : 10;
            int fontSizeForRegisterButton = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 30 : 18;
            int fontSizeForLaterButton    = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 15 : 10;

            // configurable bits
            BackgroundColor = UIColor.White.ColorWithAlpha(.7f);

            var centerPoint = new CGPoint(frame.Size.Width / 2, frame.Size.Height / 2);

            UIView backgroundModalView = new UIView(new CGRect(0, 0, UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? frame.Size.Width * .5 : frame.Size.Width * .6, UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? frame.Size.Height * .25 : frame.Size.Height * .3));

            backgroundModalView.BackgroundColor    = UIColor.White;
            backgroundModalView.Center             = centerPoint;
            backgroundModalView.Layer.CornerRadius = (float)(frame.Size.Height * .45) / 4;
            backgroundModalView.ClipsToBounds      = true;

            this.AddSubview(backgroundModalView);

            AutoresizingMask = UIViewAutoresizing.All;

            nfloat labelHeight = backgroundModalView.Frame.Height / 2.75f;
            nfloat labelWidth  = (System.nfloat)(backgroundModalView.Frame.Width * .75);

            // derive the center x and y
            nfloat centerX = backgroundModalView.Frame.Width / 2;
            nfloat centerY = backgroundModalView.Frame.Height / 2;



            solicitLabel = new UILabel(new CGRect(
                                           centerX - (labelWidth / 2),
                                           centerY - (centerY / 1.5),
                                           labelWidth,
                                           labelHeight
                                           ));
            solicitLabel.Lines     = 0;
            solicitLabel.TextColor = UIColor.Black;
            //Clay Martin 1/1/18: Change app name to BuyPlane
            solicitLabel.Text             = "Registering for GlobalAir.com BuyPlane Magazine will help us optimize and refine your experience.";
            solicitLabel.TextAlignment    = UITextAlignment.Center;
            solicitLabel.Font             = UIFont.BoldSystemFontOfSize(fontSizeForSolicitLabel);
            solicitLabel.AutoresizingMask = UIViewAutoresizing.All;
            solicitLabel.LineBreakMode    = UILineBreakMode.WordWrap;

            solicitLabel.AdjustsFontSizeToFitWidth = false;
            backgroundModalView.AddSubview(solicitLabel);

            registerButton = new UIButton(UIButtonType.RoundedRect);
            registerButton.SetTitle("REGISTER NOW!", UIControlState.Normal);
            registerButton.Frame = new CGRect(
                centerX - (labelWidth / 2),
                centerY,
                labelWidth,
                labelHeight
                );
            registerButton.Font             = UIFont.BoldSystemFontOfSize(fontSizeForRegisterButton);
            registerButton.AutoresizingMask = UIViewAutoresizing.All;
            registerButton.TouchUpInside   += (sender, e) =>
            {
                if (ParentViewController != null)
                {
                    FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(ParentViewController));

                    ParentViewController.ShowViewController(new UINavigationController(favClassificationsVC), this);

                    Hide();
                }
            };
            backgroundModalView.AddSubview(registerButton);

            laterButton = new UIButton(UIButtonType.RoundedRect);
            laterButton.SetTitle("I'LL REGISTER LATER", UIControlState.Normal);
            laterButton.Frame = new CGRect(
                centerX - (labelWidth / 2),
                centerY + (centerY / 2.5),
                labelWidth,
                labelHeight
                );
            laterButton.Font             = UIFont.BoldSystemFontOfSize(fontSizeForLaterButton);
            laterButton.AutoresizingMask = UIViewAutoresizing.All;
            laterButton.TouchUpInside   += (sender, e) =>
            {
                Hide();
            };
            backgroundModalView.AddSubview(laterButton);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            //LoadingOverlay overlay = new LoadingOverlay(this.View.Frame, "Loading aircraft data...");


            HideKeyboardGesture = new UITapGestureRecognizer(() =>
            {
                View.EndEditing(true);
            });

            DataUpdateProgressView.Progress = 0f;
            DataUpdateProgressView.Hidden   = true;



            int cornerRadius = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ? 25 : 20;

            UsernameTextField.Layer.CornerRadius    = cornerRadius;
            UsernameTextField.Layer.BorderColor     = UIColor.White.CGColor;
            UsernameTextField.Layer.BorderWidth     = 1f;
            UsernameTextField.AttributedPlaceholder = new NSAttributedString(
                "Email Address",
                font: UsernameTextField.Font,
                foregroundColor: UIColor.White
                );

            PasswordTextField.Layer.CornerRadius    = cornerRadius;
            PasswordTextField.Layer.BorderColor     = UIColor.White.CGColor;
            PasswordTextField.Layer.BorderWidth     = 1f;
            PasswordTextField.AttributedPlaceholder = new NSAttributedString(
                "Password",
                font: PasswordTextField.Font,
                foregroundColor: UIColor.White
                );

            LoginButton.Layer.CornerRadius = cornerRadius;
            LoginButton.Layer.BorderColor  = UIColor.White.CGColor;
            LoginButton.Layer.BorderWidth  = 0f;

            LaterButton.Layer.CornerRadius = cornerRadius;
            LaterButton.Layer.BorderColor  = UIColor.White.CGColor;
            LaterButton.Layer.BorderWidth  = 0f;

            changePassButton.Layer.CornerRadius = cornerRadius;
            changePassButton.Layer.BorderColor  = UIColor.White.CGColor;
            changePassButton.Layer.BorderWidth  = 0f;



            LoginButton.TouchUpInside += SubmitButton_TouchUpInside;



            UpdateMyProfileButton.Layer.CornerRadius = cornerRadius;
            UpdateMyProfileButton.TouchUpInside     += (sender, e) =>
            {
                FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(this));

                this.ShowViewController(new UINavigationController(favClassificationsVC), this);
            };

            LogoutButton.Layer.CornerRadius = cornerRadius;
            LogoutButton.TouchUpInside     += (sender, e) =>
            {
                UIView.Animate(
                    0.25,
                    () =>
                {
                    UsernameTextField.Alpha = 1f;
                    PasswordTextField.Alpha = 1f;
                    LoginButton.Alpha       = 1f;
                    LaterButton.Alpha       = 1f;
                    RegisterNowButton.Alpha = 1f;
                });

                LogoutButton.Alpha          = 0f;
                UpdateMyProfileButton.Alpha = 0f;
                changePassButton.Alpha      = 0f;

                Settings.Logout();
            };


            RegisterNowButton.TouchUpInside += (sender, e) =>
            {
                FavoriteClassificationsViewController favClassificationsVC = new FavoriteClassificationsViewController(new AircraftGridLayout(this));

                this.ShowViewController(new UINavigationController(favClassificationsVC), this);
            };
        }