Example #1
0
        public override void ViewDidLoad( )
        {
            OrientationState = -1;

            //Instantiate the Bible Web View first.
            BibleWebView = new UIWebView(new CGRect(10, 10, View.Bounds.Width - 20, View.Bounds.Height - 20));
            BibleWebView.BackgroundColor         = Rock.Mobile.UI.Util.GetUIColor(0x1C1C1CFF);
            BibleWebView.ScrollView.ContentInset = new UIEdgeInsets(10, 0, 40, 0);
            BibleWebView.Opaque = false;

            View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);
            View.AddSubview(BibleWebView);

            //Then instantiate the blocker view.
            BlockerView = new UIBlockerView(View, View.Bounds.ToRectF( ));

            ResultView = new UIResultView(View, View.Bounds.ToRectF( ),
                                          delegate
            {
                if (RequestingBiblePassage == false)
                {
                    RetrieveBiblePassage( );
                }
            });
        }
Example #2
0
        void LaunchWebview(NSUrl encodedUrl)
        {
            // setup a result view in the case of failure
            ResultView = new UIResultView(View, View.Bounds.ToRectF( ),
                                          delegate
            {
                ResultView.Hide( );
                ActivityIndicator.Hidden = false;
                WebView.LoadRequest(new NSUrlRequest(encodedUrl));
            });

            WebView.LoadRequest(new NSUrlRequest(encodedUrl));

            // if the webview controls the navbar
            if (WebviewControlsNavbar == true)
            {
                // then if we want hiding on scroll, change our delegate so we can do just that.
                if (WebviewHidesNavbarOnScroll == true)
                {
                    WebView.ScrollView.Delegate = new WebScrollDelegate(WebView, Task.NavToolbar);
                }
                else
                {
                    // otherwise force the nav toolbar to show up, and we'll leave it up

                    // of course, make sure it's still valid. IT's possible our load request returned
                    // AFTER they left this page.
                    if (Task.NavToolbar != null)
                    {
                        Task.NavToolbar.Reveal(true);
                    }
                }
            }
        }
Example #3
0
        public override void ViewDidLoad( )
        {
            base.ViewDidLoad( );

            OrientationState = -1;

            UIScrollView                   = new CustomScrollView( );
            UIScrollView.Interceptor       = this;
            UIScrollView.Frame             = View.Frame;
            UIScrollView.BackgroundColor   = Rock.Mobile.UI.Util.GetUIColor(0x1C1C1CFF);
            UIScrollView.Delegate          = new NavBarRevealHelperDelegate(Task.NavToolbar);
            UIScrollView.Layer.AnchorPoint = new CGPoint(0, 0);

            UITapGestureRecognizer tapGesture = new UITapGestureRecognizer( );

            tapGesture.NumberOfTapsRequired = 2;
            tapGesture.AddTarget(this, new ObjCRuntime.Selector("DoubleTapSelector:"));
            UIScrollView.AddGestureRecognizer(tapGesture);

            View.BackgroundColor = UIScrollView.BackgroundColor;
            View.AddSubview(UIScrollView);

            // add a busy indicator
            Indicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
            UIScrollView.AddSubview(Indicator);

            // add a refresh button for debugging
            RefreshButton = UIButton.FromType(UIButtonType.System);
            RefreshButton.SetTitle("Refresh", UIControlState.Normal);
            RefreshButton.SizeToFit( );

            // if they tap the refresh button, refresh the list
            RefreshButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                DeleteNote( );

                PrepareCreateNotes(0, true);
            };

            ResultView = new UIResultView(UIScrollView, View.Frame.ToRectF( ), OnResultViewDone);

            ResultView.Hide( );

            // setup the tutorial overlay
            TutorialBacker = new UIView( );
            TutorialBacker.Layer.AnchorPoint = CGPoint.Empty;
            TutorialBacker.Alpha             = 0.00f;
            TutorialBacker.BackgroundColor   = UIColor.Black;
            TutorialBacker.Hidden            = true;
            View.AddSubview(TutorialBacker);

            AnimatingTutorial = false;
            TutorialOverlay   = new UIImageView( );
            TutorialOverlay.Layer.AnchorPoint = CGPoint.Empty;
            TutorialOverlay.Frame             = View.Frame;
            TutorialOverlay.Alpha             = 0.00f;
            View.AddSubview(TutorialOverlay);

            KeyboardAdjustManager = new Rock.Mobile.PlatformSpecific.iOS.UI.KeyboardAdjustManager(View);
        }
Example #4
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                if (container == null)
                {
                    // Currently in a layout without a container, so no reason to create our view.
                    return null;
                }

                RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout;
                view.SetOnTouchListener( this );

                WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                WebLayout.SetBackgroundColor( Android.Graphics.Color.Black );

                view.AddView( WebLayout );

                ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ),
                    delegate
                    {
                        ResultView.Hide( );

                        if ( string.IsNullOrEmpty( Url ) == false )
                        {
                            WebLayout.LoadUrl( Url, PageLoaded );
                        }
                    } );

                return view;
            }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // don't allow anything if there isn't a watchUrl set
            if (MediaUrl == null)
            {
                throw new Exception("MediaUrl must not be null!");
            }

            // setup our activity indicator
            ActivityIndicator = new UIActivityIndicatorView();
            ActivityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White;
            ActivityIndicator.SizeToFit( );
            ActivityIndicator.StartAnimating( );

            PreloadFinished = false;

            // create the movie player control
            MoviePlayer = new MPMoviePlayerController( );
            View.AddSubview(MoviePlayer.View);

            View.AddSubview(ActivityIndicator);

            ResultView = new UIResultView(View, View.Frame.ToRectF( ), delegate { TryPlayMedia( ); });
        }
Example #6
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    View view = inflater.Inflate(Resource.Layout.Prayer_Post, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

                    ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                                  delegate
                    {
                        if (Success == true)
                        {
                            // leave
                            ParentTask.OnClick(this, 0);
                        }
                        else
                        {
                            // retry
                            SubmitPrayerRequest( );
                        }
                    });

                    BlockerView = new UIBlockerView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));


                    return(view);
                }
Example #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            BlockerView = new UIBlockerView(View, View.Frame.ToRectF( ));

            ResultView = new UIResultView(View, View.Frame.ToRectF( ),
                                          delegate
            {
                if (RequestingPrayers == false)
                {
                    RetrievePrayerRequests( );
                }
            });

            View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);

            float viewRealHeight = (float)(View.Bounds.Height - Task.NavToolbar.Frame.Height);

            float cardSizePerc = .83f;
            float cardWidth    = (float)(View.Bounds.Width * cardSizePerc);
            float cardHeight   = (float)(viewRealHeight * cardSizePerc);

            // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
            float cardYOffset = (viewRealHeight * .03f);

            Carousel = PlatformCardCarousel.Create(View, cardWidth, cardHeight, new System.Drawing.RectangleF(0, cardYOffset, (float)View.Bounds.Width, viewRealHeight), PrivatePrayerConfig.Card_AnimationDuration);

            CardSize = new CGRect(0, 0, cardWidth, cardHeight);

            LastDownload = DateTime.MinValue;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // setup our table
            NotesTableView = new UITableView( );
            NotesTableView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);
            NotesTableView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
            View.AddSubview(NotesTableView);

            ActivityIndicator = new UIActivityIndicatorView(new CGRect(View.Frame.Width / 2, View.Frame.Height / 2, 0, 0));
            ActivityIndicator.StartAnimating( );
            ActivityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White;
            ActivityIndicator.SizeToFit( );

            ResultView = new UIResultView(View, View.Frame.ToRectF( ), delegate { TrySetupSeries( ); });

            ResultView.Hide( );
        }
Example #9
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    MediaController = new MediaController(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    RelativeLayout view = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    view.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    view.SetBackgroundColor(Android.Graphics.Color.Black);
                    view.SetOnTouchListener(this);

                    VideoPlayer = new VideoView(Activity);
                    VideoPlayer.SetMediaController(MediaController);
                    VideoPlayer.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)VideoPlayer.LayoutParameters).AddRule(LayoutRules.CenterInParent);

                    ((view as RelativeLayout)).AddView(VideoPlayer);

                    VideoPlayer.SetOnPreparedListener(this);
                    VideoPlayer.SetOnErrorListener(this);

                    ProgressBar = new ProgressBar(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)ProgressBar.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    view.AddView(ProgressBar);
                    ProgressBar.BringToFront();

                    ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), delegate { TryPlayMedia( ); });

                    return(view);
                }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ResultView = new UIResultView(View, View.Frame.ToRectF( ),
                                          delegate
            {
                if (Success == true)
                {
                    NavigationController.PopToRootViewController(true);
                }
                else
                {
                    Task.NavToolbar.Reveal(false);
                    SubmitPrayerRequest( );
                }
            });

            BlockerView = new UIBlockerView(View, View.Frame.ToRectF( ));

            //setup our appearance
            View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);
        }
Example #11
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    RelativeLayout view = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    view.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    view.SetBackgroundColor(Android.Graphics.Color.Black);
                    view.SetOnTouchListener(this);

                    ProgressBar = new ProgressBar(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)ProgressBar.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    view.AddView(ProgressBar);

                    // setup our media controller for viewing the position of media
                    MediaController = new MediaController(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    MediaController.SetAnchorView(view);

                    ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                                  delegate
                    {
                        // we know we're bound, so now just retry.
                        ResultView.Hide( );
                        PlayerState = MediaPlayerState.Preparing;
                        StartAudio( );
                        SyncUI( );
                    });

                    return(view);
                }
Example #12
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                if (container == null)
                {
                    // Currently in a layout without a container, so no reason to create our view.
                    return(null);
                }

                RelativeLayout view = inflater.Inflate(Resource.Layout.BiblePassage, container, false) as RelativeLayout;

                view.SetOnTouchListener(this);

                PassageWebView = new WebView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                PassageWebView.SetBackgroundColor(Android.Graphics.Color.Rgb(28, 28, 28));
                PassageWebView.SetPadding(10, 0, 40, 0);

                view.AddView(PassageWebView);
                view.SetBackgroundColor(Android.Graphics.Color.Rgb(28, 28, 28));

                // get our power management control
                PowerManager pm = PowerManager.FromContext(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Bible Passage");

                BlockerView = new UIBlockerView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels));

                ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                              delegate
                {
                    if (RequestingBiblePassage == false)
                    {
                        RetrieveBiblePassage( );
                    }
                });

                return(view);
            }
Example #13
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                if (container == null)
                {
                    // Currently in a layout without a container, so no reason to create our view.
                    return(null);
                }

                RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout;

                view.SetOnTouchListener(this);

                WebLayout = new WebLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                WebLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                WebLayout.SetBackgroundColor(Android.Graphics.Color.Black);

                view.AddView(WebLayout);

                ResultView = new UIResultView(view, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels),
                                              delegate
                {
                    ResultView.Hide( );

                    if (string.IsNullOrEmpty(Url) == false)
                    {
                        ProcessUrl( );
                    }
                });

                // get our power management control
                PowerManager pm = PowerManager.FromContext(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "TaskWeb");

                return(view);
            }
Example #14
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                // Currently in a layout without a container, so no reason to create our view.
                return(null);
            }

            View view = inflater.Inflate(Resource.Layout.Register, container, false);

            view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));
            view.SetOnTouchListener(this);

            ScrollView = view.FindViewById <ScrollView>(Resource.Id.scroll_background);

            RelativeLayout layoutView = view.FindViewById <RelativeLayout>(Resource.Id.scroll_linear_background);

            ProgressBarBlocker                         = view.FindViewById <RelativeLayout>(Resource.Id.progressBarBlocker);
            ProgressBarBlocker.Visibility              = ViewStates.Gone;
            ProgressBarBlocker.LayoutParameters        = new RelativeLayout.LayoutParams(0, 0);
            ProgressBarBlocker.LayoutParameters.Width  = NavbarFragment.GetFullDisplayWidth( );
            ProgressBarBlocker.LayoutParameters.Height = this.Resources.DisplayMetrics.HeightPixels;

            ResultView = new UIResultView(layoutView, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnResultViewDone);

            RelativeLayout navBar = view.FindViewById <RelativeLayout>(Resource.Id.navbar_relative_layout);

            navBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));


            // setup the username
            UserNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.username_background);
            ControlStyling.StyleBGLayer(UserNameLayer);

            UserNameText = UserNameLayer.FindViewById <EditText>(Resource.Id.userNameText);
            ControlStyling.StyleTextField(UserNameText, RegisterStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            UserNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            UserNameText.InputType |= InputTypes.TextFlagCapWords;

            View borderView = UserNameLayer.FindViewById <View>(Resource.Id.username_border);

            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            // password
            PasswordLayer = view.FindViewById <RelativeLayout>(Resource.Id.password_background);
            ControlStyling.StyleBGLayer(PasswordLayer);

            PasswordText            = PasswordLayer.FindViewById <EditText>(Resource.Id.passwordText);
            PasswordText.InputType |= InputTypes.TextVariationPassword;
            ControlStyling.StyleTextField(PasswordText, RegisterStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            PasswordBGColor = ControlStylingConfig.BG_Layer_Color;

            borderView = PasswordLayer.FindViewById <View>(Resource.Id.password_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));



            ConfirmPasswordLayer = view.FindViewById <RelativeLayout>(Resource.Id.confirmPassword_background);
            ControlStyling.StyleBGLayer(ConfirmPasswordLayer);

            ConfirmPasswordText            = ConfirmPasswordLayer.FindViewById <EditText>(Resource.Id.confirmPasswordText);
            ConfirmPasswordText.InputType |= InputTypes.TextVariationPassword;
            ControlStyling.StyleTextField(ConfirmPasswordText, RegisterStrings.ConfirmPasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ConfirmPasswordBGColor = ControlStylingConfig.BG_Layer_Color;



            // setup the name section
            NickNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.firstname_background);
            ControlStyling.StyleBGLayer(NickNameLayer);

            NickNameText = NickNameLayer.FindViewById <EditText>(Resource.Id.nickNameText);
            ControlStyling.StyleTextField(NickNameText, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            NickNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            NickNameText.InputType |= InputTypes.TextFlagCapWords;

            borderView = NickNameLayer.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            LastNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.lastname_background);
            ControlStyling.StyleBGLayer(LastNameLayer);

            LastNameText = LastNameLayer.FindViewById <EditText>(Resource.Id.lastNameText);
            ControlStyling.StyleTextField(LastNameText, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            LastNameBGColor         = ControlStylingConfig.BG_Layer_Color;
            LastNameText.InputType |= InputTypes.TextFlagCapWords;


            // setup the cell phone section
            CellPhoneLayer = view.FindViewById <RelativeLayout>(Resource.Id.cellphone_background);
            ControlStyling.StyleBGLayer(CellPhoneLayer);

            CellPhoneText = CellPhoneLayer.FindViewById <EditText>(Resource.Id.cellPhoneText);
            ControlStyling.StyleTextField(CellPhoneText, RegisterStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CellPhoneText.AddTextChangedListener(new PhoneNumberFormattingTextWatcher());


            // email layer
            EmailLayer = view.FindViewById <RelativeLayout>(Resource.Id.email_background);
            ControlStyling.StyleBGLayer(EmailLayer);

            borderView = EmailLayer.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            EmailText = EmailLayer.FindViewById <EditText>(Resource.Id.emailAddressText);
            ControlStyling.StyleTextField(EmailText, RegisterStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            EmailBGColor = ControlStylingConfig.BG_Layer_Color;


            // Register button
            RegisterButton = view.FindViewById <Button>(Resource.Id.registerButton);
            ControlStyling.StyleButton(RegisterButton, RegisterStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);

            CancelButton = view.FindViewById <Button>(Resource.Id.cancelButton);
            ControlStyling.StyleButton(CancelButton, GeneralStrings.Cancel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            CancelButton.Background = null;

            RegisterButton.Click += (object sender, EventArgs e) =>
            {
                RegisterUser( );
            };

            CancelButton.Click += (object sender, EventArgs e) =>
            {
                // Since they made changes, confirm they want to save them.
                AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
                builder.SetTitle(RegisterStrings.ConfirmCancelReg);

                Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[]
                {
                    new Java.Lang.String(GeneralStrings.Yes),
                    new Java.Lang.String(GeneralStrings.No)
                };

                builder.SetItems(strings, delegate(object s, DialogClickEventArgs clickArgs)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        switch (clickArgs.Which)
                        {
                        case 0: SpringboardParent.ModalFragmentDone(null); break;

                        case 1: break;
                        }
                    });
                });

                builder.Show( );
            };

            return(view);
        }
Example #15
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();


            // setup the fake header
            HeaderView = new UIView( );
            View.AddSubview(HeaderView);
            HeaderView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);

            // set the title image for the bar if there's no safe area defined. (A safe area is like, say, the notch for iPhone X)
            nfloat safeAreaTopInset = 0;

            // Make sure they're on iOS 11 before checking for insets. This is only needed for iPhone X anyways, which shipped with iOS 11.
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                safeAreaTopInset = UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Top;
            }

            if (safeAreaTopInset == 0)
            {
                string imagePath = NSBundle.MainBundle.BundlePath + "/" + PrivatePrimaryNavBarConfig.LogoFile_iOS;
                LogoView = new UIImageView(new UIImage(imagePath));
                LogoView.Layer.AnchorPoint = CGPoint.Empty;
                LogoView.SizeToFit( );
                HeaderView.AddSubview(LogoView);
            }

            ScrollView       = new UIScrollViewWrapper();
            ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height);
            View.AddSubview(ScrollView);
            ScrollView.Parent = this;

            // logged in sanity check.
            //if( RockMobileUser.Instance.LoggedIn == true ) throw new Exception("A user cannot be logged in when registering. How did you do this?" );

            BlockerView = new UIBlockerView(View, View.Frame.ToRectF( ));

            //setup styles
            View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);

            UserNameText = new StyledTextField();
            ScrollView.AddSubview(UserNameText.Background);
            UserNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            UserNameText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(UserNameText.Field, RegisterStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(UserNameText.Background);

            PasswordText = new StyledTextField();
            ScrollView.AddSubview(PasswordText.Background);
            PasswordText.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            PasswordText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            PasswordText.Field.SecureTextEntry        = true;
            ControlStyling.StyleTextField(PasswordText.Field, RegisterStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(PasswordText.Background);

            ConfirmPasswordText = new StyledTextField();
            ScrollView.AddSubview(ConfirmPasswordText.Background);
            ConfirmPasswordText.Field.SecureTextEntry = true;
            ControlStyling.StyleTextField(ConfirmPasswordText.Field, RegisterStrings.ConfirmPasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(ConfirmPasswordText.Background);

            NickNameText = new StyledTextField();
            ScrollView.AddSubview(NickNameText.Background);
            NickNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            NickNameText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(NickNameText.Field, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(NickNameText.Background);

            LastNameText = new StyledTextField();
            ScrollView.AddSubview(LastNameText.Background);
            LastNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            LastNameText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(LastNameText.Field, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(LastNameText.Background);

            EmailText = new StyledTextField();
            ScrollView.AddSubview(EmailText.Background);
            EmailText.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            EmailText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(EmailText.Field, RegisterStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(EmailText.Background);

            CellPhoneText = new StyledTextField();
            ScrollView.AddSubview(CellPhoneText.Background);
            CellPhoneText.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            CellPhoneText.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(CellPhoneText.Field, RegisterStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(CellPhoneText.Background);

            DoneButton = UIButton.FromType(UIButtonType.System);
            ScrollView.AddSubview(DoneButton);
            ControlStyling.StyleButton(DoneButton, RegisterStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            DoneButton.SizeToFit( );


            CancelButton = UIButton.FromType(UIButtonType.System);
            ScrollView.AddSubview(CancelButton);
            CancelButton.SetTitleColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor), UIControlState.Normal);
            CancelButton.SetTitle(GeneralStrings.Cancel, UIControlState.Normal);
            CancelButton.SizeToFit( );


            // Allow the return on username and password to start
            // the login process
            NickNameText.Field.ShouldReturn += TextFieldShouldReturn;
            LastNameText.Field.ShouldReturn += TextFieldShouldReturn;

            EmailText.Field.ShouldReturn += TextFieldShouldReturn;

            // If submit is pressed with dirty changes, prompt the user to save them.
            DoneButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                RegisterUser( );

                HideKeyboard( );
            };

            // On logout, make sure the user really wants to log out.
            CancelButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // if there were changes, create an action sheet for them to confirm.
                UIAlertController actionSheet = UIAlertController.Create(RegisterStrings.ConfirmCancelReg,
                                                                         null,
                                                                         UIAlertControllerStyle.ActionSheet);

                if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    actionSheet.PopoverPresentationController.SourceView = CancelButton;
                    actionSheet.PopoverPresentationController.SourceRect = CancelButton.Bounds;
                }

                UIAlertAction yesAction = UIAlertAction.Create(GeneralStrings.Yes, UIAlertActionStyle.Destructive, delegate
                {
                    Springboard.ResignModelViewController(this, null);
                });
                actionSheet.AddAction(yesAction);


                // let them cancel, too
                UIAlertAction cancelAction = UIAlertAction.Create(GeneralStrings.Cancel, UIAlertActionStyle.Cancel, delegate { });
                actionSheet.AddAction(cancelAction);

                PresentViewController(actionSheet, true, null);
            };

            ResultView = new UIResultView(ScrollView, View.Frame.ToRectF( ), OnResultViewDone);
        }
Example #16
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    base.OnCreateView( inflater, container, savedInstanceState );

                    // get the root control from our .axml
                    var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout;

                    // get the refresh button from the layout
                    RefreshButton = layout.FindViewById<Button>( Resource.Id.refreshButton );

                    // create our overridden lockable scroll view
                    ScrollView = new LockableScrollView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.ScrollBarStyle = ScrollbarStyles.InsideInset;
                    ScrollView.OverScrollMode = OverScrollMode.Always;
                    ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default;
                    ScrollView.LayoutParameters = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                    ScrollView.Notes = this;
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal);
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton);

                    // add it to our main layout.
                    layout.AddView( ScrollView );

                    Indicator = layout.FindViewById<ProgressBar>( Resource.Id.progressBar );
                    Indicator.Visibility = ViewStates.Gone;
                    Indicator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    Indicator.BringToFront();

                    // create the layout that will contain the notes
                    ScrollViewLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ScrollView.AddView( ScrollViewLayout );
                    ScrollViewLayout.SetOnTouchListener( this );

                    RefreshButton.Click += (object sender, EventArgs e ) =>
                    {
                        DeleteNote( );

                        PrepareCreateNotes(  );
                    };

                    // if the refresh button isn't enabled, hide it
                    if ( App.Shared.Network.RockGeneralData.Instance.Data.RefreshButtonEnabled == false )
                    {
                        RefreshButton.Visibility = ViewStates.Gone;
                    }

                    // get our power management control
                    PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes");

                    ResultView = new UIResultView( layout, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone );

                    ResultView.Hide( );

                    // setup the tutorial overlay
                    AnimatingTutorial = false;
                    TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    TutorialOverlay.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    TutorialOverlay.Alpha = 0;
                    TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Black );
                    layout.AddView( TutorialOverlay );

                    NavBarRevealTracker = new NavBarReveal( ParentTask.NavbarFragment.NavToolbar );

                    return layout;
                }
Example #17
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return null;
                    }

                    View view = inflater.Inflate(Resource.Layout.Prayer_Post, container, false);
                    view.SetOnTouchListener( this );

                    view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) );

                    ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ),
                        delegate
                        {
                            if( Success == true )
                            {
                                // leave
                                ParentTask.OnClick( this, 0 );
                            }
                            else
                            {
                                // retry
                                SubmitPrayerRequest( );
                            }
                        } );

                    BlockerView = new UIBlockerView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) );

                    return view;
                }
Example #18
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                // Currently in a layout without a container, so no reason to create our view.
                return(null);
            }

            View view = inflater.Inflate(Resource.Layout.Profile, container, false);

            view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

            RelativeLayout navBar = view.FindViewById <RelativeLayout>(Resource.Id.navbar_relative_layout);

            navBar.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

            // setup the name section
            NickNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.firstname_background);
            ControlStyling.StyleBGLayer(NickNameLayer);

            NickNameText = NickNameLayer.FindViewById <EditText>(Resource.Id.nickNameText);
            ControlStyling.StyleTextField(NickNameText, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            NickNameBGColor                = ControlStylingConfig.BG_Layer_Color;
            NickNameText.InputType        |= InputTypes.TextFlagCapWords;
            NickNameText.AfterTextChanged += (sender, e) => { Dirty = true; };

            View borderView = NickNameLayer.FindViewById <View>(Resource.Id.middle_border);

            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            LastNameLayer = view.FindViewById <RelativeLayout>(Resource.Id.lastname_background);
            ControlStyling.StyleBGLayer(LastNameLayer);

            LastNameText = LastNameLayer.FindViewById <EditText>(Resource.Id.lastNameText);
            ControlStyling.StyleTextField(LastNameText, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            LastNameBGColor                = ControlStylingConfig.BG_Layer_Color;
            LastNameText.InputType        |= InputTypes.TextFlagCapWords;
            LastNameText.AfterTextChanged += (sender, e) => { Dirty = true; };


            // setup the contact section
            EmailLayer = view.FindViewById <RelativeLayout>(Resource.Id.email_background);
            ControlStyling.StyleBGLayer(EmailLayer);
            EmailBGColor = ControlStylingConfig.BG_Layer_Color;

            EmailField = EmailLayer.FindViewById <EditText>(Resource.Id.emailAddressText);
            ControlStyling.StyleTextField(EmailField, ProfileStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            EmailField.AfterTextChanged += (sender, e) => { Dirty = true; };

            View backgroundView = view.FindViewById <RelativeLayout>(Resource.Id.cellphone_background);

            ControlStyling.StyleBGLayer(backgroundView);

            borderView = backgroundView.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            CellPhoneField = backgroundView.FindViewById <EditText>(Resource.Id.cellPhoneText);
            ControlStyling.StyleTextField(CellPhoneField, ProfileStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CellPhoneField.AfterTextChanged += (sender, e) => { Dirty = true; };
            CellPhoneField.AddTextChangedListener(new PhoneNumberFormattingTextWatcher());


            // setup the address section
            backgroundView = view.FindViewById <RelativeLayout>(Resource.Id.address_background);
            ControlStyling.StyleBGLayer(backgroundView);

            StreetField = backgroundView.FindViewById <EditText>(Resource.Id.streetAddressText);
            ControlStyling.StyleTextField(StreetField, ProfileStrings.StreetPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            StreetField.AfterTextChanged += (sender, e) => { Dirty = true; };
            StreetField.InputType        |= InputTypes.TextFlagCapWords;

            borderView = backgroundView.FindViewById <View>(Resource.Id.street_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            CityField = backgroundView.FindViewById <EditText>(Resource.Id.cityAddressText);
            ControlStyling.StyleTextField(CityField, ProfileStrings.CityPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CityField.AfterTextChanged += (sender, e) => { Dirty = true; };
            CityField.InputType        |= InputTypes.TextFlagCapWords;

            borderView = backgroundView.FindViewById <View>(Resource.Id.city_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            StateField = backgroundView.FindViewById <EditText>(Resource.Id.stateAddressText);
            ControlStyling.StyleTextField(StateField, ProfileStrings.StatePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            StateField.AfterTextChanged += (sender, e) => { Dirty = true; };
            StateField.InputType        |= InputTypes.TextFlagCapWords;

            borderView = backgroundView.FindViewById <View>(Resource.Id.state_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            ZipField = backgroundView.FindViewById <EditText>(Resource.Id.zipAddressText);
            ControlStyling.StyleTextField(ZipField, ProfileStrings.ZipPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ZipField.AfterTextChanged += (sender, e) => { Dirty = true; };


            // personal
            backgroundView = view.FindViewById <RelativeLayout>(Resource.Id.personal_background);
            ControlStyling.StyleBGLayer(backgroundView);

            BirthdateField = backgroundView.FindViewById <EditText>(Resource.Id.birthdateText);
            ControlStyling.StyleTextField(BirthdateField, ProfileStrings.BirthdatePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            BirthdateField.FocusableInTouchMode = false;
            BirthdateField.Focusable            = false;
            Button birthdateButton = backgroundView.FindViewById <Button>(Resource.Id.birthdateButton);

            birthdateButton.Click += (object sender, EventArgs e) =>
            {
                // setup the initial date to use ( either now, or the date in the field )
                DateTime initialDateTime = DateTime.Now;
                if (string.IsNullOrWhiteSpace(BirthdateField.Text) == false)
                {
                    initialDateTime = DateTime.Parse(BirthdateField.Text);
                }

                // build our
                LayoutInflater dateInflate = LayoutInflater.From(Activity);
                DatePicker     newPicker   = (DatePicker)dateInflate.Inflate(Resource.Layout.DatePicker, null);
                newPicker.Init(initialDateTime.Year, initialDateTime.Month - 1, initialDateTime.Day, this);

                Dialog dialog = new Dialog(Activity);
                dialog.AddContentView(newPicker, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
                dialog.Show( );
            };

            borderView = backgroundView.FindViewById <View>(Resource.Id.middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            // Gender
            GenderField = view.FindViewById <EditText>(Resource.Id.genderText);
            ControlStyling.StyleTextField(GenderField, ProfileStrings.GenderPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            GenderField.FocusableInTouchMode = false;
            GenderField.Focusable            = false;
            Button genderButton = backgroundView.FindViewById <Button>(Resource.Id.genderButton);

            genderButton.Click += (object sender, EventArgs e) =>
            {
                AlertDialog.Builder        builder = new AlertDialog.Builder(Activity);
                Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[]
                {
                    new Java.Lang.String(RockLaunchData.Instance.Data.Genders[1]),
                    new Java.Lang.String(RockLaunchData.Instance.Data.Genders[2]),
                };

                builder.SetItems(strings, delegate(object s, DialogClickEventArgs clickArgs)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        GenderField.Text = RockLaunchData.Instance.Data.Genders[clickArgs.Which + 1];
                        Dirty            = true;
                    });
                });

                builder.Show( );
            };

            borderView = backgroundView.FindViewById <View>(Resource.Id.campus_middle_border);
            borderView.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_BorderColor));

            // Campus
            CampusField = view.FindViewById <EditText>(Resource.Id.campusText);
            ControlStyling.StyleTextField(CampusField, ProfileStrings.CampusPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            CampusField.FocusableInTouchMode = false;
            CampusField.Focusable            = false;
            Button campusButton = backgroundView.FindViewById <Button>(Resource.Id.campusButton);

            campusButton.Click += (object sender, EventArgs e) =>
            {
                // build an alert dialog containing all the campus choices
                AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
                builder.SetTitle(ProfileStrings.SelectCampus_SourceTitle);
                Java.Lang.ICharSequence [] campusStrings = new Java.Lang.ICharSequence[RockLaunchData.Instance.Data.Campuses.Count];
                for (int i = 0; i < RockLaunchData.Instance.Data.Campuses.Count; i++)
                {
                    campusStrings[i] = new Java.Lang.String(RockLaunchData.Instance.Data.Campuses[i].Name);
                }

                // launch the dialog, and on selection, update the viewing campus text.
                builder.SetItems(campusStrings, delegate(object s, DialogClickEventArgs clickArgs)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        int campusIndex  = clickArgs.Which;
                        CampusField.Text = RockLaunchData.Instance.Data.Campuses[campusIndex].Name;
                        Dirty            = true;
                    });
                });

                builder.Show( );
            };

            // Done buttons
            DoneButton = view.FindViewById <Button>(Resource.Id.doneButton);
            ControlStyling.StyleButton(DoneButton, ProfileStrings.DoneButtonTitle, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);

            LogoutButton = view.FindViewById <Button>(Resource.Id.logoutButton);
            ControlStyling.StyleButton(LogoutButton, ProfileStrings.LogoutButtonTitle, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize);
            LogoutButton.Background = null;

            DoneButton.Click += (object sender, EventArgs e) =>
            {
                if (Dirty == true)
                {
                    if (ValidateInput( ))
                    {
                        // Since they made changes, confirm they want to save them.
                        AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
                        builder.SetTitle(ProfileStrings.SubmitChangesTitle);

                        Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[]
                        {
                            new Java.Lang.String(GeneralStrings.Yes),
                            new Java.Lang.String(GeneralStrings.No),
                            new Java.Lang.String(GeneralStrings.Cancel)
                        };

                        builder.SetItems(strings, delegate(object s, DialogClickEventArgs clickArgs)
                        {
                            Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                            {
                                switch (clickArgs.Which)
                                {
                                case 0: SubmitChanges( ); SpringboardParent.ModalFragmentDone(null); break;

                                case 1: SpringboardParent.ModalFragmentDone(null); break;

                                case 2: break;
                                }
                            });
                        });

                        builder.Show( );
                    }
                }
                else
                {
                    SpringboardParent.ModalFragmentDone(null);
                }
            };

            LogoutButton.Click += (object sender, EventArgs e) =>
            {
                // Since they made changes, confirm they want to save them.
                AlertDialog.Builder builder = new AlertDialog.Builder(Activity);
                builder.SetTitle(ProfileStrings.LogoutTitle);

                Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[]
                {
                    new Java.Lang.String(GeneralStrings.Yes),
                    new Java.Lang.String(GeneralStrings.No)
                };

                builder.SetItems(strings, delegate(object s, DialogClickEventArgs clickArgs)
                {
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        switch (clickArgs.Which)
                        {
                        case 0: RockMobileUser.Instance.LogoutAndUnbind( ); SpringboardParent.ModalFragmentDone(null); break;

                        case 1: break;
                        }
                    });
                });

                builder.Show( );
            };

            // blocker and result views
            ScrollView = view.FindViewById <LockableScrollView>(Resource.Id.scroll_view);
            ScrollView.ScrollEnabled = false;

            // scroll to the top
            ScrollView.Post(new Action(delegate
            {
                ScrollView.ForceScrollTo(0, 0);
            }));

            RelativeLayout parentLayout = view.FindViewById <RelativeLayout>(Resource.Id.relative_layout);

            RectangleF bounds = new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels);

            BlockerView = new UIBlockerView(parentLayout, bounds);
            BlockerView.Hide( );

            ResultView = new UIResultView(parentLayout, bounds, delegate
            {
                SpringboardParent.ModalFragmentDone(null);
            });
            ResultView.Hide( );

            return(view);
        }
Example #19
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    base.OnCreateView(inflater, container, savedInstanceState);

                    // get the root control from our .axml
                    var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout;

                    // get the refresh button from the layout
                    RefreshButton = layout.FindViewById <Button>(Resource.Id.refreshButton);

                    // create our overridden lockable scroll view
                    ScrollView = new LockableScrollView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ScrollView.ScrollBarStyle            = ScrollbarStyles.InsideInset;
                    ScrollView.OverScrollMode            = OverScrollMode.Always;
                    ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default;
                    ScrollView.LayoutParameters          = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                    ScrollView.OnTouchIntercept          = OnInterceptTouchEvent;
                    ScrollView.OnChangedScroll           = OnScrollChanged;
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal);
                    ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton);

                    // add it to our main layout.
                    layout.AddView(ScrollView);

                    Indicator            = layout.FindViewById <ProgressBar>(Resource.Id.progressBar);
                    Indicator.Visibility = ViewStates.Gone;
                    Indicator.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(0));
                    Indicator.BringToFront();

                    // create the layout that will contain the notes
                    ScrollViewLayout = new RelativeLayout(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    ScrollView.AddView(ScrollViewLayout);
                    ScrollViewLayout.SetOnTouchListener(this);

                    RefreshButton.Click += (object sender, EventArgs e) =>
                    {
                        DeleteNote( );

                        PrepareCreateNotes(  );
                    };

                    // if the refresh button isn't enabled, hide it
                    if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == false)
                    {
                        RefreshButton.Visibility = ViewStates.Gone;
                    }

                    // get our power management control
                    PowerManager pm = PowerManager.FromContext(Rock.Mobile.PlatformSpecific.Android.Core.Context);

                    WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes");

                    ResultView = new UIResultView(layout, new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels), OnResultViewDone);

                    ResultView.Hide( );

                    // setup the tutorial overlay
                    TutorialBacker = new View(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    TutorialBacker.Alpha            = 0;
                    TutorialBacker.SetBackgroundColor(Android.Graphics.Color.Black);
                    layout.AddView(TutorialBacker);

                    AnimatingTutorial = false;
                    TutorialOverlay   = new ImageView(Rock.Mobile.PlatformSpecific.Android.Core.Context);
                    TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
                    ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters).AddRule(LayoutRules.CenterInParent);
                    TutorialOverlay.Alpha = 0;
                    TutorialOverlay.SetBackgroundColor(Android.Graphics.Color.Transparent);
                    layout.AddView(TutorialOverlay);

                    NavBarRevealTracker = new NavBarReveal( );

                    return(layout);
                }
Example #20
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            RefreshProfileTimer           = new System.Timers.Timer();
            RefreshProfileTimer.AutoReset = true;
            RefreshProfileTimer.Interval  = 300 * 1000; // every 5 minutes
            RefreshProfileTimer.Elapsed  += (object sender, System.Timers.ElapsedEventArgs e) =>
            {
                Rock.Mobile.Threading.Util.PerformOnUIThread(
                    delegate
                {
                    RefreshProfile( );
                });
            };

            // setup the fake header
            HeaderView = new UIView( );
            View.AddSubview(HeaderView);

            HeaderView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);

            // set the title image for the bar if there's no safe area defined. (A safe area is like, say, the notch for iPhone X)
            nfloat safeAreaTopInset = 0;

            // Make sure they're on iOS 11 before checking for insets. This is only needed for iPhone X anyways, which shipped with iOS 11.
            if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0))
            {
                safeAreaTopInset = UIApplication.SharedApplication.KeyWindow.SafeAreaInsets.Top;
            }

            if (safeAreaTopInset == 0)
            {
                string imagePath = NSBundle.MainBundle.BundlePath + "/" + PrivatePrimaryNavBarConfig.LogoFile_iOS;
                LogoView = new UIImageView(new UIImage(imagePath));
                LogoView.SizeToFit( );
                LogoView.Layer.AnchorPoint = CGPoint.Empty;
                HeaderView.AddSubview(LogoView);
            }

            ScrollView = new UIScrollViewWrapper();

            View.AddSubview(ScrollView);
            ScrollView.Parent = this;

            BlockerView = new UIBlockerView(ScrollView, View.Bounds.ToRectF( ));

            //setup styles
            View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor);

            NickName = new StyledTextField();
            ScrollView.AddSubview(NickName.Background);

            ControlStyling.StyleTextField(NickName.Field, ProfileStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(NickName.Background);
            NickName.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            NickName.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            NickName.Field.EditingDidBegin       += (sender, e) => { Dirty = true; };

            LastName = new StyledTextField();

            LastName.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            LastName.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(LastName.Field, ProfileStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(LastName.Background);
            LastName.Field.EditingDidBegin += (sender, e) => { Dirty = true; };

            Email = new StyledTextField();
            ScrollView.AddSubview(Email.Background);
            Email.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            Email.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ScrollView.AddSubview(LastName.Background);
            ControlStyling.StyleTextField(Email.Field, ProfileStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(Email.Background);
            Email.Field.EditingDidBegin += (sender, e) => { Dirty = true; };

            CellPhone = new StyledTextField();
            ScrollView.AddSubview(CellPhone.Background);
            CellPhone.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            CellPhone.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(CellPhone.Field, ProfileStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(CellPhone.Background);
            CellPhone.Field.EditingDidBegin += (sender, e) => { Dirty = true; };


            Street = new StyledTextField();
            ScrollView.AddSubview(Street.Background);
            Street.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            Street.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(Street.Field, ProfileStrings.StreetPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(Street.Background);
            Street.Field.EditingDidBegin += (sender, e) => { Dirty = true; };

            City = new StyledTextField();
            ScrollView.AddSubview(City.Background);
            City.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            City.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(City.Field, ProfileStrings.CityPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(City.Background);
            City.Field.EditingDidBegin += (sender, e) => { Dirty = true; };

            State = new StyledTextField();
            ScrollView.AddSubview(State.Background);
            State.Field.AutocapitalizationType = UITextAutocapitalizationType.Words;
            State.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(State.Field, ProfileStrings.StatePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(State.Background);
            State.Field.EditingDidBegin += (sender, e) => { Dirty = true; };

            Zip = new StyledTextField();
            ScrollView.AddSubview(Zip.Background);
            Zip.Field.AutocapitalizationType = UITextAutocapitalizationType.None;
            Zip.Field.AutocorrectionType     = UITextAutocorrectionType.No;
            ControlStyling.StyleTextField(Zip.Field, ProfileStrings.ZipPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(Zip.Background);
            Zip.Field.EditingDidBegin += (sender, e) => { Dirty = true; };


            // Gender
            Gender = new StyledTextField();
            ScrollView.AddSubview(Gender.Background);
            Gender.Field.UserInteractionEnabled = false;
            ControlStyling.StyleTextField(Gender.Field, ProfileStrings.GenderPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(Gender.Background);

            GenderButton = new UIButton( );
            ScrollView.AddSubview(GenderButton);
            GenderButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // don't allow multiple pickers
                if (GenderPicker.Revealed == false && BirthdatePicker.Revealed == false)
                {
                    HideKeyboard( );

                    // if they have a gender selected, default to that.
                    if (string.IsNullOrWhiteSpace(Gender.Field.Text) == false)
                    {
                        ((UIPickerView)GenderPicker.Picker).Select(RockLaunchData.Instance.Data.Genders.IndexOf(Gender.Field.Text) - 1, 0, false);
                    }

                    GenderPicker.TogglePicker(true);
                }
            };
            //

            // Birthday
            Birthdate = new StyledTextField( );
            ScrollView.AddSubview(Birthdate.Background);
            Birthdate.Field.UserInteractionEnabled = false;
            ControlStyling.StyleTextField(Birthdate.Field, ProfileStrings.BirthdatePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(Birthdate.Background);

            BirthdayButton = new UIButton( );
            ScrollView.AddSubview(BirthdayButton);
            BirthdayButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // don't allow multiple pickers
                if (GenderPicker.Revealed == false && BirthdatePicker.Revealed == false)
                {
                    HideKeyboard( );

                    // setup the default date time to display
                    DateTime initialDate = DateTime.Now;
                    if (string.IsNullOrWhiteSpace(Birthdate.Field.Text) == false)
                    {
                        initialDate = DateTime.Parse(Birthdate.Field.Text);
                    }

                    ((UIDatePicker)BirthdatePicker.Picker).Date = initialDate.DateTimeToNSDate( );
                    BirthdatePicker.TogglePicker(true);
                }
            };
            //


            // setup the home campus chooser
            HomeCampus = new StyledTextField( );
            ScrollView.AddSubview(HomeCampus.Background);
            HomeCampus.Field.UserInteractionEnabled = false;
            ControlStyling.StyleTextField(HomeCampus.Field, ProfileStrings.CampusPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            ControlStyling.StyleBGLayer(HomeCampus.Background);

            HomeCampusButton = new UIButton( );
            ScrollView.AddSubview(HomeCampusButton);
            HomeCampusButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                UIAlertController actionSheet = UIAlertController.Create(ProfileStrings.SelectCampus_SourceTitle,
                                                                         ProfileStrings.SelectCampus_SourceDescription,
                                                                         UIAlertControllerStyle.ActionSheet);

                // if the device is a tablet, anchor the menu
                if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                {
                    actionSheet.PopoverPresentationController.SourceView = HomeCampusButton;
                    actionSheet.PopoverPresentationController.SourceRect = HomeCampusButton.Bounds;
                }

                // for each campus, create an entry in the action sheet, and its callback will assign
                // that campus index to the user's viewing preference
                for (int i = 0; i < RockLaunchData.Instance.Data.Campuses.Count; i++)
                {
                    UIAlertAction campusAction = UIAlertAction.Create(RockLaunchData.Instance.Data.Campuses[i].Name, UIAlertActionStyle.Default, delegate(UIAlertAction obj)
                    {
                        // update the home campus text and flag as dirty
                        HomeCampus.Field.Text = obj.Title;
                        Dirty = true;
                    });

                    actionSheet.AddAction(campusAction);
                }

                // let them cancel, too
                UIAlertAction cancelAction = UIAlertAction.Create(GeneralStrings.Cancel, UIAlertActionStyle.Cancel, delegate { });
                actionSheet.AddAction(cancelAction);

                PresentViewController(actionSheet, true, null);
            };

            DoneButton = new UIButton( );
            ScrollView.AddSubview(DoneButton);
            ControlStyling.StyleButton(DoneButton, ProfileStrings.DoneButtonTitle, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            DoneButton.SizeToFit( );

            LogoutButton = new UIButton( );
            ScrollView.AddSubview(LogoutButton);
            LogoutButton.SetTitleColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_PlaceholderTextColor), UIControlState.Normal);
            LogoutButton.SetTitle(ProfileStrings.LogoutButtonTitle, UIControlState.Normal);
            LogoutButton.SizeToFit( );


            // setup the pickers
            UILabel genderPickerLabel = new UILabel( );

            ControlStyling.StyleUILabel(genderPickerLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            genderPickerLabel.Text = ProfileStrings.SelectGenderLabel;

            GenderPicker = new PickerAdjustManager(View, ScrollView, genderPickerLabel, Gender.Background);
            UIPickerView genderPicker = new UIPickerView();

            genderPicker.Model = new GenderPickerModel()
            {
                Parent = this
            };
            GenderPicker.SetPicker(genderPicker);


            UILabel birthdatePickerLabel = new UILabel( );

            ControlStyling.StyleUILabel(birthdatePickerLabel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);
            birthdatePickerLabel.Text = ProfileStrings.SelectBirthdateLabel;
            BirthdatePicker           = new PickerAdjustManager(View, ScrollView, birthdatePickerLabel, Birthdate.Background);

            UIDatePicker datePicker = new UIDatePicker();

            datePicker.SetValueForKey(UIColor.White, new NSString("textColor"));
            datePicker.Mode          = UIDatePickerMode.Date;
            datePicker.MinimumDate   = new DateTime(1900, 1, 1).DateTimeToNSDate( );
            datePicker.MaximumDate   = DateTime.Now.DateTimeToNSDate( );
            datePicker.ValueChanged += (object sender, EventArgs e) =>
            {
                NSDate pickerDate = ((UIDatePicker)sender).Date;
                Birthdate.Field.Text = string.Format("{0:MMMMM dd yyyy}", pickerDate.NSDateToDateTime( ));
            };
            BirthdatePicker.SetPicker(datePicker);


            // Allow the return on username and password to start
            // the login process
            NickName.Field.ShouldReturn += TextFieldShouldReturn;
            LastName.Field.ShouldReturn += TextFieldShouldReturn;

            Email.Field.ShouldReturn += TextFieldShouldReturn;

            // If submit is pressed with dirty changes, prompt the user to save them.
            DoneButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // dont' allow changes while the profile is refreshing.
                if (RefreshingProfile == false)
                {
                    if (GenderPicker.Revealed == false && BirthdatePicker.Revealed == false)
                    {
                        if (Dirty == true)
                        {
                            // make sure the input is valid before asking them what they want to do.
                            if (ValidateInput( ))
                            {
                                // if there were changes, create an action sheet for them to confirm.
                                UIAlertController actionSheet = UIAlertController.Create(ProfileStrings.SubmitChangesTitle,
                                                                                         null,
                                                                                         UIAlertControllerStyle.ActionSheet);

                                if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                                {
                                    actionSheet.PopoverPresentationController.SourceView = DoneButton;
                                    actionSheet.PopoverPresentationController.SourceRect = DoneButton.Bounds;
                                }

                                UIAlertAction submitAction = UIAlertAction.Create(GeneralStrings.Yes, UIAlertActionStyle.Default, delegate
                                {
                                    Dirty = false; SubmitChanges( ); Springboard.ResignModelViewController(this, null);
                                });
                                actionSheet.AddAction(submitAction);

                                UIAlertAction noSubmitAction = UIAlertAction.Create(GeneralStrings.No, UIAlertActionStyle.Destructive, delegate
                                {
                                    Dirty = false; Springboard.ResignModelViewController(this, null);
                                });
                                actionSheet.AddAction(noSubmitAction);

                                // let them cancel, too
                                UIAlertAction cancelAction = UIAlertAction.Create(GeneralStrings.Cancel, UIAlertActionStyle.Cancel, delegate { });
                                actionSheet.AddAction(cancelAction);

                                PresentViewController(actionSheet, true, null);
                            }
                        }
                        else
                        {
                            Springboard.ResignModelViewController(this, null);
                        }
                    }
                    else
                    {
                        GenderPicker.TogglePicker(false);
                        BirthdatePicker.TogglePicker(false);
                        Dirty = true;
                    }
                }
            };

            // On logout, make sure the user really wants to log out.
            LogoutButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // don't allow changes while the profile is refreshing
                if (RefreshingProfile == false)
                {
                    if (GenderPicker.Revealed == false && BirthdatePicker.Revealed == false)
                    {
                        // if they tap logout, and confirm it
                        UIAlertController actionSheet = UIAlertController.Create(ProfileStrings.LogoutTitle,
                                                                                 null,
                                                                                 UIAlertControllerStyle.ActionSheet);

                        if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
                        {
                            actionSheet.PopoverPresentationController.SourceView = LogoutButton;
                            actionSheet.PopoverPresentationController.SourceRect = LogoutButton.Bounds;
                        }

                        UIAlertAction logoutAction = UIAlertAction.Create(GeneralStrings.Yes, UIAlertActionStyle.Destructive, delegate
                        {
                            // then log them out.
                            RockMobileUser.Instance.LogoutAndUnbind( );

                            Springboard.ResignModelViewController(this, null);
                        });
                        actionSheet.AddAction(logoutAction);

                        // let them cancel, too
                        UIAlertAction cancelAction = UIAlertAction.Create(GeneralStrings.Cancel, UIAlertActionStyle.Cancel, delegate { });
                        actionSheet.AddAction(cancelAction);

                        PresentViewController(actionSheet, true, null);
                    }
                    else
                    {
                        GenderPicker.TogglePicker(false);
                        BirthdatePicker.TogglePicker(false);
                        Dirty = true;
                    }
                }
            };

            ResultView = new UIResultView(ScrollView, View.Bounds.ToRectF( ),
                                          delegate
            {
                Springboard.ResignModelViewController(this, null);
            });

            Dirty = false;

            // logged in sanity check.
            if (RockMobileUser.Instance.LoggedIn == false)
            {
                throw new Exception("A user must be logged in before viewing a profile. How did you do this?");
            }
        }
Example #21
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return null;
                    }

                    RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent );
                    view.SetBackgroundColor( Android.Graphics.Color.Black );
                    view.SetOnTouchListener( this );

                    ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    ProgressBar.Indeterminate = true;
                    ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) );
                    ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent );
                    ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent );
                    view.AddView( ProgressBar );

                    // setup our media controller for viewing the position of media
                    MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context );
                    MediaController.SetAnchorView( view );
                    MediaController.SetMediaPlayer( this );

                    ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ),
                        delegate
                        {
                            // we know we're bound, so now just retry.

                            ResultView.Hide( );
                            PlayerState = MediaPlayerState.Preparing;
                            StartAudio( );
                            SyncUI( );
                        });

                    return view;
                }