Example #1
0
 public void SettingsComplete( )
 {
     SettingsViewController.DismissViewController(true, null);
 }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // First setup the SpringboardReveal button, which rests in the upper left
            // of the MainNavigationUI. (We must do it here because the ContainerViewController's
            // NavBar is the active one.)
            NSString buttonLabel = new NSString("");

            HomeButton      = new UIButton(UIButtonType.System);
            HomeButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont("Bh", 36);
            HomeButton.SetTitle(buttonLabel.ToString( ), UIControlState.Normal);
            HomeButton.SetTitleColor(Theme.GetColor(Config.Instance.VisualSettings.TopHeaderTextColor), UIControlState.Normal);
            HomeButton.SetTitleColor(UIColor.DarkGray, UIControlState.Disabled);

            // determine its dimensions
            CGSize buttonSize = buttonLabel.StringSize(HomeButton.Font);

            HomeButton.Bounds = new CGRect(0, 0, buttonSize.Width, buttonSize.Height);

            // set its callback
            HomeButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // clear any current family VC
                CurrentFamilyInfoViewController = null;

                // reset our stack
                SubNavigationController.PopToRootViewController(true);
                SubNavigationController.View.SetNeedsLayout( );

                // turn off the home button
                HomeButton.Enabled = false;

                // and enable the add family button
                AddFamilyButton.Enabled = true;
            };


            // set the "Add Family" button
            buttonLabel = new NSString("");

            AddFamilyButton      = new UIButton(UIButtonType.System);
            AddFamilyButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont("Bh", 36);
            AddFamilyButton.SetTitle(buttonLabel.ToString( ), UIControlState.Normal);
            AddFamilyButton.SetTitleColor(Theme.GetColor(Config.Instance.VisualSettings.TopHeaderTextColor), UIControlState.Normal);
            AddFamilyButton.SetTitleColor(UIColor.DarkGray, UIControlState.Disabled);

            // determine its dimensions
            buttonSize             = buttonLabel.StringSize(HomeButton.Font);
            AddFamilyButton.Bounds = new CGRect(0, 0, buttonSize.Width, buttonSize.Height);

            // set its callback
            AddFamilyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // clear any current family VC
                CurrentFamilyInfoViewController = null;

                // and present a new family page
                PresentNewFamilyPage( );
            };

            UIBarButtonItem[] leftItems = new UIBarButtonItem[]
            {
                new UIBarButtonItem(HomeButton),
                new UIBarButtonItem(AddFamilyButton)
            };
            this.NavigationItem.SetLeftBarButtonItems(leftItems, false);

            CreateSubNavigationController( );

            SearchFamiliesViewController = new SearchFamiliesViewController(this);
            SubNavigationController.PushViewController(SearchFamiliesViewController, true);

            HomeButton.Enabled = false;

            SettingsViewController = new SettingsViewController(this);

            // set our theme
            CoreViewController.ApplyTheme(this);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // First setup the SpringboardReveal button, which rests in the upper left
            // of the MainNavigationUI. (We must do it here because the ContainerViewController's
            // NavBar is the active one.)
            NSString buttonLabel = new NSString( "" );

            HomeButton = new UIButton(UIButtonType.System);
            HomeButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont( "Bh", 36 );
            HomeButton.SetTitle( buttonLabel.ToString( ), UIControlState.Normal );
            HomeButton.SetTitleColor( Theme.GetColor( Config.Instance.VisualSettings.TopHeaderTextColor ), UIControlState.Normal );
            HomeButton.SetTitleColor( UIColor.DarkGray, UIControlState.Disabled );

            // determine its dimensions
            CGSize buttonSize = buttonLabel.StringSize( HomeButton.Font );
            HomeButton.Bounds = new CGRect( 0, 0, buttonSize.Width, buttonSize.Height );

            // set its callback
            HomeButton.TouchUpInside += (object sender, EventArgs e) =>
                {
                    // clear any current family VC
                    CurrentFamilyInfoViewController = null;

                    // reset our stack
                    SubNavigationController.PopToRootViewController( true );
                    SubNavigationController.View.SetNeedsLayout( );

                    // turn off the home button
                    HomeButton.Enabled = false;

                    // and enable the add family button
                    AddFamilyButton.Enabled = true;
                };

            // set the "Add Family" button
            buttonLabel = new NSString( "" );

            AddFamilyButton = new UIButton(UIButtonType.System);
            AddFamilyButton.Font = Rock.Mobile.PlatformSpecific.iOS.Graphics.FontManager.GetFont( "Bh", 36 );
            AddFamilyButton.SetTitle( buttonLabel.ToString( ), UIControlState.Normal );
            AddFamilyButton.SetTitleColor( Theme.GetColor( Config.Instance.VisualSettings.TopHeaderTextColor ), UIControlState.Normal );
            AddFamilyButton.SetTitleColor( UIColor.DarkGray, UIControlState.Disabled );

            // determine its dimensions
            buttonSize = buttonLabel.StringSize( HomeButton.Font );
            AddFamilyButton.Bounds = new CGRect( 0, 0, buttonSize.Width, buttonSize.Height );

            // set its callback
            AddFamilyButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                // clear any current family VC
                CurrentFamilyInfoViewController = null;

                // and present a new family page
                PresentNewFamilyPage( );
            };

            UIBarButtonItem[] leftItems = new UIBarButtonItem[]
            {
                new UIBarButtonItem( HomeButton ),
                new UIBarButtonItem( AddFamilyButton )
            };
            this.NavigationItem.SetLeftBarButtonItems( leftItems, false );

            CreateSubNavigationController( );

            SearchFamiliesViewController = new SearchFamiliesViewController( this );
            SubNavigationController.PushViewController( SearchFamiliesViewController, true );

            HomeButton.Enabled = false;

            SettingsViewController = new SettingsViewController( this );

            // set our theme
            CoreViewController.ApplyTheme( this );
        }