예제 #1
0
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            // enable all controls
            EnableControls(true);

            // todo: determine if we're coming back from the post page.
            UISwitchAnonymous.SetState(false, false);
            UIPublicSwitch.SetState(false, false);

            TogglePlaceholderText( );

            // prepopulate the name fields if we have them
            if (RockMobileUser.Instance.LoggedIn == true)
            {
                FirstName.Field.Text = RockMobileUser.Instance.Person.NickName;
                LastName.Field.Text  = RockMobileUser.Instance.Person.LastName;
                Email.Field.Text     = RockMobileUser.Instance.Person.Email;
            }

            // monitor for text field being edited, and keyboard show/hide notitications
            NSObject handle = NSNotificationCenter.DefaultCenter.AddObserver(Rock.Mobile.PlatformSpecific.iOS.UI.KeyboardAdjustManager.TextControlChangedNotification, OnTextChanged);

            ObserverHandles.Add(handle);

            KeyboardAdjustManager.Activate( );
        }
예제 #2
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            KeyboardAdjustManager.Activate( );

            UIApplication.SharedApplication.IdleTimerDisabled = true;
            Rock.Mobile.Util.Debug.WriteLine("Turning idle timer OFF");
        }
예제 #3
0
        public void PresentAnimated(int workingFamilyId, bool browsingPeople, FamilyInfoViewController.OnBrowsePeopleCompleteDelegate onComplete)
        {
            KeyboardAdjustManager.Activate( );

            WorkingFamilyId = workingFamilyId;

            OnCompleteDelegate = onComplete;

            // default to false
            RemoveFromOtherFamilies = false;

            // always begin at the SearchPanel
            SearchPanel.GetRootView( ).Layer.Position = CGPoint.Empty;

            PeoplePanel.GetRootView( ).Layer.Position = new CGPoint(MainPanel.Bounds.Width, 0);

            // use the provided bool to set the correct panel visible
            PeoplePanel.GetRootView( ).Hidden = !browsingPeople;

            ActivePanel = SearchPanel;

            View.Hidden = false;

            // animate the background to dark
            BackgroundPanel.Layer.Opacity = 0;

            SimpleAnimator_Float alphaAnim = new SimpleAnimator_Float(BackgroundPanel.Layer.Opacity, Settings.DarkenOpacity, .33f,
                                                                      delegate(float percent, object value)
            {
                BackgroundPanel.Layer.Opacity = (float)value;
            }, null);

            alphaAnim.Start(SimpleAnimator.Style.CurveEaseOut);


            // animate in the main panel
            MainPanel.Layer.Position = new CoreGraphics.CGPoint((View.Bounds.Width - MainPanel.Bounds.Width) / 2, View.Bounds.Height);

            // animate UP the main panel
            nfloat visibleHeight = Parent.GetVisibleHeight( );
            PointF endPos        = new PointF((float)(View.Bounds.Width - MainPanel.Bounds.Width) / 2,
                                              (float)(visibleHeight - MainPanel.Bounds.Height) / 2);

            SimpleAnimator_PointF posAnim = new SimpleAnimator_PointF(MainPanel.Layer.Position.ToPointF( ), endPos, .33f,
                                                                      delegate(float percent, object value)
            {
                MainPanel.Layer.Position = (PointF)value;
            },
                                                                      delegate
            {
                SearchPanel.PerformSearch( );
            });


            posAnim.Start(SimpleAnimator.Style.CurveEaseOut);
        }