Beispiel #1
0
                protected void PrepareCreateNotes( )
                {
                    if (RefreshingNotes == false)
                    {
                        ResultView.Hide( );

                        RefreshingNotes = true;

                        ShutdownNotes(null);

                        // show a busy indicator
                        Indicator.Visibility = ViewStates.Visible;

                        Note.TryDownloadNote(NoteUrl, false, delegate(bool result)
                        {
                            if (result == true)
                            {
                                CreateNotes( );
                            }
                            else
                            {
                                ReportException("", null);
                            }
                        });
                    }
                }
Beispiel #2
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            // reset the background colors
            UserNameText.Background.BackgroundColor        = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);
            PasswordText.Background.BackgroundColor        = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);
            ConfirmPasswordText.Background.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);

            NickNameText.Background.BackgroundColor  = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);
            LastNameText.Background.BackgroundColor  = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);
            EmailText.Background.BackgroundColor     = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);
            CellPhoneText.Background.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BG_Layer_Color);

            ScrollView.ContentOffset = CGPoint.Empty;

            // set values
            UserNameText.Field.Text = string.Empty;

            PasswordText.Field.Text        = string.Empty;
            ConfirmPasswordText.Field.Text = string.Empty;

            NickNameText.Field.Text = string.Empty;
            LastNameText.Field.Text = string.Empty;

            EmailText.Field.Text = string.Empty;

            // setup the phone number
            CellPhoneText.Field.Delegate = new Rock.Mobile.PlatformSpecific.iOS.UI.PhoneNumberFormatterDelegate();
            CellPhoneText.Field.Text     = string.Empty;
            CellPhoneText.Field.Delegate.ShouldChangeCharacters(CellPhoneText.Field, new NSRange(CellPhoneText.Field.Text.Length, 0), "");

            State = RegisterState.None;
            ResultView.Hide( );
        }
Beispiel #3
0
        void RetrieveBiblePassage( )
        {
            ResultView.Hide( );

            BlockerView.Show(delegate
            {
                RequestingBiblePassage = true;

                BibleRenderer.RetrieveBiblePassage(BibleAddress, delegate(string htmlStream)
                {
                    // if it worked, take the html stream and store it
                    if (string.IsNullOrWhiteSpace(htmlStream) == false)
                    {
                        PassageHTML = htmlStream;
                        BibleWebView.LoadHtmlString(PassageHTML, NSBundle.MainBundle.BundleUrl);
                    }
                    else
                    {
                        // otherwise display an error
                        ResultView.Show(GeneralStrings.Network_Status_FailedText,
                                        PrivateControlStylingConfig.Result_Symbol_Failed,
                                        GeneralStrings.Network_Result_FailedText,
                                        GeneralStrings.Retry);
                    }

                    RequestingBiblePassage = false;
                    BlockerView.Hide(null);
                });
            });
        }
        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);
                    }
                }
            }
        }
Beispiel #5
0
        void OnResultViewDone( )
        {
            //hack - Can't figure out WHY the join button isn't in the proper Z order on the Nexus 7.
            // but I just don't care right now. So hide it and unhide it.
            JoinButton.Hidden = false;
            EnableControls(true);

            ResultView.Hide( );
        }
Beispiel #6
0
        void OnResultViewDone( )
        {
            //hack - Can't figure out WHY the join button isn't in the proper Z order on the Nexus 7.
            // but I just don't care right now. So hide it and unhide it.
            JoinButton.Hidden = false;

            ResultView.Hide( );

            Internal_DisplayView( );
        }
        public void HandleLoadFinished( )
        {
            if (ResultView != null)
            {
                ResultView.Hide( );
            }

            // if we're preloading, then the black page just finished
            if (PreloadComplete == false)
            {
                // now, seriously, kick off a timer so that the renderer has time to
                // display its default white screen, then render the html.
                // This will hide the white flicker and look a lot nicer to the end user.
                System.Timers.Timer timer = new System.Timers.Timer();
                timer.Interval  = 500;
                timer.AutoReset = false;
                timer.Elapsed  += (object sender, System.Timers.ElapsedEventArgs e) =>
                {
                    // do this ON the UI thread
                    Rock.Mobile.Threading.Util.PerformOnUIThread(delegate
                    {
                        WebView.Hidden  = false;
                        PreloadComplete = true;
                        PerformRequest( );
                    });
                };
                timer.Start( );
            }
            else
            {
                ActivityIndicator.Hidden = true;

                // if we control the nav toolbar, we enable the back button only when
                // there's something to go "back" to.
                if (WebviewControlsNavbar == true)
                {
                    // 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.SetBackButtonEnabled(WebView.CanGoBack);
                    }
                }
            }
        }
        void TrySetupSeries( )
        {
            NotesTableView.Hidden = true;
            ResultView.Hide( );

            // what's the state of the series xml?
            if (RockLaunchData.Instance.RequestingNoteDB == true)
            {
                // it's in the process of downloading, so wait and poll.
                View.AddSubview(ActivityIndicator);
                View.BringSubviewToFront(ActivityIndicator);
                ActivityIndicator.Hidden = false;

                // kick off a thread that will poll the download status and
                // call "SeriesReady()" when the download is finished.
                Thread waitThread = new Thread(WaitAsync);
                waitThread.Start( );

                while (waitThread.IsAlive == false)
                {
                    ;
                }
            }
            else if (RockLaunchData.Instance.NeedSeriesDownload( ) == true)
            {
                // it hasn't been downloaded, or failed, or something. Point is we
                // don't have anything, so request it.
                View.AddSubview(ActivityIndicator);
                View.BringSubviewToFront(ActivityIndicator);
                ActivityIndicator.Hidden = false;

                RockLaunchData.Instance.GetNoteDB(delegate
                {
                    // don't worry about the result. The point is we tried,
                    // and now will either use downloaded data, saved data, or throw an error to the user.
                    SeriesReady( );
                });
            }
            else
            {
                // we have the series, so we can move forward.
                SeriesReady( );
            }
        }
Beispiel #9
0
        void OnResultViewDone( )
        {
            switch (State)
            {
            case RegisterState.Success:
            {
                Springboard.ResignModelViewController(this, null);
                ScrollView.ScrollEnabled = true;
                State = RegisterState.None;
                break;
            }

            case RegisterState.Fail:
            {
                ResultView.Hide( );
                ScrollView.ScrollEnabled = true;
                State = RegisterState.None;
                break;
            }
            }
        }
        void RefreshProfile( )
        {
            // don't allow a double refresh, obviously.
            if (RefreshingProfile == false)
            {
                RefreshingProfile = true;

                ResultView.Hide( );
                BlockerView.BringToFront( );

                BlockerView.Show(
                    delegate
                {
                    RockMobileUser.Instance.GetPersonData(delegate(System.Net.HttpStatusCode statusCode, string statusDescription)
                    {
                        RefreshingProfile = false;

                        if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true)
                        {
                            // show the latest profile info
                            ModelToUI( );
                        }
                        else
                        {
                            // show failure prompt
                            ResultView.Show(ProfileStrings.ProfileErrorTitle, PrivateControlStylingConfig.Result_Symbol_Failed, ProfileStrings.ProfileErrorDesc, GeneralStrings.Ok);

                            // if the result is "Not Found", then that means their login is no longer valid. Force a logout.
                            if (statusCode == System.Net.HttpStatusCode.NotFound)
                            {
                                // then log them out.
                                RockMobileUser.Instance.LogoutAndUnbind( );
                            }
                        }

                        BlockerView.Hide(null);
                    });
                });
            }
        }
Beispiel #11
0
        void OnResultViewDone( )
        {
            // now allow controls to receive input
            ToggleControls(true);

            switch (State)
            {
            case RegisterState.Success:
            {
                SpringboardParent.ModalFragmentDone(null);
                State = RegisterState.None;
                break;
            }

            case RegisterState.Fail:
            {
                ResultView.Hide( );
                State = RegisterState.None;
                break;
            }
            }
        }
Beispiel #12
0
        public void DisplayView(string groupTitle, string distance, string meetingTime, int groupId)
        {
            // store the group ID as we'll need it if they hit submit
            GroupID = groupId;

            // set the group title
            GroupTitle.Text = groupTitle;
            GroupTitle.SizeToFit( );

            // set the details for the group (distance, meeting time, etc)
            GroupDetails.Text          = meetingTime + "\n" + distance;
            GroupDetails.TextAlignment = TextAlignment.Center;
            GroupDetails.SizeToFit( );

            FirstName.Text = MobileApp.Shared.Network.RockMobileUser.Instance.Person.NickName;
            LastName.Text  = MobileApp.Shared.Network.RockMobileUser.Instance.Person.LastName;


            Email.Text     = MobileApp.Shared.Network.RockMobileUser.Instance.Person.Email;
            CellPhone.Text = MobileApp.Shared.Network.RockMobileUser.Instance.CellPhoneNumberDigits( );

            ResultView.Hide( );
        }
Beispiel #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 = 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);
                }
Beispiel #14
0
        public override void ViewDidDisappear(bool animated)
        {
            base.ViewDidDisappear(animated);

            ResultView.Hide( );
        }