예제 #1
0
        void EnterNextState(OOBE_State nextState)
        {
            switch (nextState)
            {
            case OOBE_State.NetworkError:
            {
                PerformNetworkError( );
                break;
            }

            case OOBE_State.Welcome:
            {
                PerformWelcome( );
                break;
            }

            /*case OOBE_State.CampusIntro:
             * {
             *  PerformCampusIntro( );
             *  break;
             * }
             *
             * case OOBE_State.SelectCampus:
             * {
             *  PerformSelectCampus( );
             *  break;
             * }
             *
             * case OOBE_State.WaitForCampus:
             * {
             *  // just wait for them to pick
             *  break;
             * }*/

            case OOBE_State.AccountChoice:
            {
                PerformAccountChoice( );
                break;
            }

            case OOBE_State.WaitForAccountChoice:
            {
                break;
            }
            }

            State = nextState;
        }
예제 #2
0
        void EnterNextState( OOBE_State nextState )
        {
            switch( nextState )
            {
                case OOBE_State.Startup:
                {
                    PerformStartup( ); 
                    break;
                }

                case OOBE_State.Welcome:
                {
                    PerformWelcome( );
                    break;
                }

                case OOBE_State.CampusIntro:
                {
                    PerformCampusIntro( );
                    break;
                }

                case OOBE_State.SelectCampus:
                {
                    PerformSelectCampus( );
                    break;
                }

                case OOBE_State.WaitForCampus:
                {
                    // just wait for them to pick
                    break;
                }

                case OOBE_State.AccountChoice:
                {
                    PerformAccountChoice( );
                    break;
                }

                case OOBE_State.WaitForAccountChoice:
                {
                    break;
                }
            }

            State = nextState;
        }
예제 #3
0
        public void Create( object masterView, string bgLayerImageName, string logoImageName, bool scaleImageLogo, RectangleF frame, OnButtonClick onClick )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            View.AddAsSubview( masterView );

            ImageBG = PlatformImageView.Create( true );
            ImageBG.AddAsSubview( View.PlatformNativeObject );
            MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream( bgLayerImageName );
            if ( stream != null )
            {
                stream.Position = 0;
                ImageBG.Opacity = 0;
                ImageBG.Image = stream;
                ImageBG.SizeToFit( );
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFill;
                stream.Dispose( );
            }

            WelcomeLabel = PlatformLabel.Create( );
            WelcomeLabel.SetFont( ControlStylingConfig.Font_Bold, 85 );
            WelcomeLabel.TextColor = 0xCCCCCCFF;
            WelcomeLabel.Text = OOBEStrings.Welcome;
            WelcomeLabel.Opacity = 0;
            WelcomeLabel.SizeToFit( );
            WelcomeLabel.AddAsSubview( View.PlatformNativeObject );


            // TODO: We need to support scrolling for the eventual day we have too many campuses for a single screen.
            // TODO: We should be downloading these before display, but I don't want to risk that for the first release.
            // Setup campuses
            CampusHeader = PlatformLabel.Create( );
            CampusHeader.SetFont( ControlStylingConfig.Font_Light, 18 );
            CampusHeader.TextColor = 0xCCCCCCFF;
            CampusHeader.Text = OOBEStrings.CampusIntro;
            CampusHeader.TextAlignment = TextAlignment.Center;
            CampusHeader.Opacity = 0;
            CampusHeader.SizeToFit( );
            CampusHeader.AddAsSubview( View.PlatformNativeObject );

            CampusButtons = new List<PlatformButton>( );
            foreach ( Rock.Client.Campus campus in App.Shared.Network.RockGeneralData.Instance.Data.Campuses )
            {
                PlatformButton campusButton = PlatformButton.Create( );
                campusButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
                campusButton.TextColor = 0xCCCCCCFF;
                campusButton.Text = campus.Name;
                campusButton.Opacity = 0;
                campusButton.SizeToFit( );
                campusButton.ClickEvent = (PlatformButton button ) =>
                    {
                        // do not allow multiple campus button taps
                        if( State == OOBE_State.WaitForCampus )
                        {
                            onClick( campus.Id, true );

                            EnterNextState( OOBE_State.AccountChoice );
                            PerformAccountChoice( );
                        }
                    };
                campusButton.AddAsSubview( View.PlatformNativeObject );

                CampusButtons.Add( campusButton );
            }


            RegisterButton = PlatformButton.Create( );
            RegisterButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            RegisterButton.TextColor = 0xCCCCCCFF;
            RegisterButton.Text = string.Format( OOBEStrings.WantAccount, GeneralConfig.OrganizationShortName );
            RegisterButton.Opacity = 0;
            RegisterButton.SizeToFit( );
            RegisterButton.ClickEvent = (PlatformButton button ) =>
                {
                    // do not allow multiple register taps
                    if( State == OOBE_State.WaitForAccountChoice )
                    {
                        onClick( 0, false );

                        EnterNextState( OOBE_State.Done );
                    }
                };
            RegisterButton.AddAsSubview( View.PlatformNativeObject );


            RegisterSeperator = PlatformView.Create( );
            RegisterSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            RegisterSeperator.Bounds = new RectangleF( 0, 0, 0, 1 );
            RegisterSeperator.AddAsSubview( View.PlatformNativeObject );


            LoginButton = PlatformButton.Create( );
            LoginButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            LoginButton.TextColor = 0xCCCCCCFF;
            LoginButton.Text = string.Format( OOBEStrings.HaveAccount, GeneralConfig.OrganizationShortName );
            LoginButton.Opacity = 0;
            LoginButton.SizeToFit( );
            LoginButton.ClickEvent = (PlatformButton button ) =>
                {
                    // do not allow multiple register taps
                    if( State == OOBE_State.WaitForAccountChoice )
                    {
                        onClick( 1, false );

                        EnterNextState( OOBE_State.Done );
                    }
                };
            LoginButton.AddAsSubview( View.PlatformNativeObject );

            LoginSeperator = PlatformView.Create( );
            LoginSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            LoginSeperator.Bounds = new RectangleF( 0, 0, 0, 1 );
            LoginSeperator.AddAsSubview( View.PlatformNativeObject );


            SkipButton = PlatformButton.Create( );
            SkipButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            SkipButton.TextColor = 0xCCCCCCFF;
            SkipButton.Text = OOBEStrings.SkipAccount;
            SkipButton.Opacity = 0;
            SkipButton.SizeToFit( );
            SkipButton.ClickEvent = (PlatformButton button ) =>
                {
                    // do not allow multiple register taps
                    if( State == OOBE_State.WaitForAccountChoice )
                    {
                        onClick( 2, false );

                        EnterNextState( OOBE_State.Done );
                    }
                };
            SkipButton.AddAsSubview( View.PlatformNativeObject );

            stream = Rock.Mobile.IO.AssetConvert.AssetToStream( logoImageName );
            stream.Position = 0;
            ImageLogo = PlatformImageView.Create( scaleImageLogo );
            ImageLogo.AddAsSubview( View.PlatformNativeObject );
            ImageLogo.Image = stream;
            ImageLogo.SizeToFit( );
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            stream.Dispose( );

            State = OOBE_State.Startup;
        }
예제 #4
0
        public void Create(object masterView, string bgLayerImageName, string logoImageName, RectangleF frame, OnButtonClick onClick)
        {
            // take the handler
            OnClick = onClick;

            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            View.AddAsSubview(masterView);

            ImageBG = PlatformImageView.Create( );
            ImageBG.AddAsSubview(View.PlatformNativeObject);
            MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream(bgLayerImageName);

            if (stream != null)
            {
                stream.Position        = 0;
                ImageBG.Opacity        = 0;
                ImageBG.Image          = stream;
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFill;
                stream.Dispose( );
            }

            NetworkErrorLabel = PlatformLabel.Create( );
            NetworkErrorLabel.SetFont(ControlStylingConfig.Font_Light, 18);
            NetworkErrorLabel.TextColor     = 0xCCCCCCFF;
            NetworkErrorLabel.Text          = OOBEStrings.NetworkError;
            NetworkErrorLabel.TextAlignment = TextAlignment.Center;
            NetworkErrorLabel.Opacity       = 0;
            NetworkErrorLabel.SizeToFit( );
            NetworkErrorLabel.AddAsSubview(View.PlatformNativeObject);


            NetworkRetryButton = PlatformButton.Create( );
            NetworkRetryButton.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            NetworkRetryButton.TextColor = 0xCCCCCCFF;
            NetworkRetryButton.Text      = OOBEStrings.NetworRetry;
            NetworkRetryButton.Opacity   = 0;
            NetworkRetryButton.SizeToFit( );
            NetworkRetryButton.ClickEvent = (PlatformButton button ) =>
            {
                OnClick(-1, false);
            };
            NetworkRetryButton.AddAsSubview(View.PlatformNativeObject);


            WelcomeLabel = PlatformLabel.Create( );
            WelcomeLabel.SetFont(ControlStylingConfig.Font_Bold, 85);
            WelcomeLabel.TextColor = 0xCCCCCCFF;
            WelcomeLabel.Text      = OOBEStrings.Welcome;
            WelcomeLabel.Opacity   = 0;
            WelcomeLabel.SizeToFit( );
            WelcomeLabel.AddAsSubview(View.PlatformNativeObject);

            CampusHeader = PlatformLabel.Create( );
            CampusHeader.SetFont(ControlStylingConfig.Font_Light, 18);
            CampusHeader.TextColor     = 0xCCCCCCFF;
            CampusHeader.Text          = OOBEStrings.CampusIntro;
            CampusHeader.TextAlignment = TextAlignment.Center;
            CampusHeader.Opacity       = 0;
            CampusHeader.SizeToFit( );
            CampusHeader.AddAsSubview(View.PlatformNativeObject);

            // we'll wait to setup campuses until after a successful download
            CampusButtons = new List <PlatformButton>( );

            RegisterButton = PlatformButton.Create( );
            RegisterButton.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize);
            RegisterButton.TextColor = 0xCCCCCCFF;
            RegisterButton.Text      = string.Format(OOBEStrings.WantAccount, GeneralConfig.OrganizationShortName);
            RegisterButton.Opacity   = 0;
            RegisterButton.SizeToFit( );
            RegisterButton.ClickEvent = (PlatformButton button ) =>
            {
                // do not allow multiple register taps
                if (State == OOBE_State.WaitForAccountChoice)
                {
                    OnClick(0, false);

                    EnterNextState(OOBE_State.Done);
                }
            };
            RegisterButton.AddAsSubview(View.PlatformNativeObject);


            RegisterSeperator = PlatformView.Create( );
            RegisterSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            RegisterSeperator.Bounds          = new RectangleF(0, 0, 0, 1);
            RegisterSeperator.AddAsSubview(View.PlatformNativeObject);


            LoginButton = PlatformButton.Create( );
            LoginButton.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize);
            LoginButton.TextColor = 0xCCCCCCFF;
            LoginButton.Text      = string.Format(OOBEStrings.HaveAccount, GeneralConfig.OrganizationShortName);
            LoginButton.Opacity   = 0;
            LoginButton.SizeToFit( );
            LoginButton.ClickEvent = (PlatformButton button ) =>
            {
                // do not allow multiple register taps
                if (State == OOBE_State.WaitForAccountChoice)
                {
                    OnClick(1, false);

                    EnterNextState(OOBE_State.Done);
                }
            };
            LoginButton.AddAsSubview(View.PlatformNativeObject);

            LoginSeperator = PlatformView.Create( );
            LoginSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            LoginSeperator.Bounds          = new RectangleF(0, 0, 0, 1);
            LoginSeperator.AddAsSubview(View.PlatformNativeObject);


            SkipButton = PlatformButton.Create( );
            SkipButton.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize);
            SkipButton.TextColor = 0xCCCCCCFF;
            SkipButton.Text      = OOBEStrings.SkipAccount;
            SkipButton.Opacity   = 0;
            SkipButton.SizeToFit( );
            SkipButton.ClickEvent = (PlatformButton button ) =>
            {
                // do not allow multiple register taps
                if (State == OOBE_State.WaitForAccountChoice)
                {
                    OnClick(2, false);

                    EnterNextState(OOBE_State.Done);
                }
            };
            SkipButton.AddAsSubview(View.PlatformNativeObject);

            stream          = Rock.Mobile.IO.AssetConvert.AssetToStream(logoImageName);
            stream.Position = 0;
            ImageLogo       = PlatformImageView.Create( );
            ImageLogo.AddAsSubview(View.PlatformNativeObject);
            ImageLogo.Image          = stream;
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            stream.Dispose( );

            State = OOBE_State.Startup;
        }
예제 #5
0
파일: UIOOBE.cs 프로젝트: jhawkzz/CCVApp
        public void Create( object masterView, string bgLayerImageName, string logoImageName, RectangleF frame, OnButtonClick onClick )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            View.AddAsSubview( masterView );

            ImageBG = PlatformImageView.Create( true );
            ImageBG.AddAsSubview( View.PlatformNativeObject );
            MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream( bgLayerImageName );
            stream.Position = 0;
            ImageBG.Opacity = 0;
            ImageBG.Image = stream;
            ImageBG.SizeToFit( );
            ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFill;
            stream.Dispose( );

            WelcomeLabel = PlatformLabel.Create( );
            WelcomeLabel.SetFont( ControlStylingConfig.Font_Bold, 85 );
            WelcomeLabel.TextColor = 0xCCCCCCFF;
            WelcomeLabel.Text = OOBEStrings.Welcome;
            WelcomeLabel.Opacity = 0;
            WelcomeLabel.SizeToFit( );
            WelcomeLabel.AddAsSubview( View.PlatformNativeObject );

            RegisterButton = PlatformButton.Create( );
            RegisterButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            RegisterButton.TextColor = 0xCCCCCCFF;
            RegisterButton.Text = string.Format( OOBEStrings.WantAccount, GeneralConfig.OrganizationShortName );
            RegisterButton.Opacity = 0;
            RegisterButton.SizeToFit( );
            RegisterButton.ClickEvent = (PlatformButton button ) =>
            {
                onClick( 0 );
            };
            RegisterButton.AddAsSubview( View.PlatformNativeObject );

            RegisterSeperator = PlatformView.Create( );
            RegisterSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            RegisterSeperator.Bounds = new RectangleF( 0, 0, 0, 1 );
            RegisterSeperator.AddAsSubview( View.PlatformNativeObject );

            LoginButton = PlatformButton.Create( );
            LoginButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            LoginButton.TextColor = 0xCCCCCCFF;
            LoginButton.Text = string.Format( OOBEStrings.HaveAccount, GeneralConfig.OrganizationShortName );
            LoginButton.Opacity = 0;
            LoginButton.SizeToFit( );
            LoginButton.ClickEvent = (PlatformButton button ) =>
                {
                    onClick( 1 );
                };
            LoginButton.AddAsSubview( View.PlatformNativeObject );

            LoginSeperator = PlatformView.Create( );
            LoginSeperator.BackgroundColor = ControlStylingConfig.BG_Layer_BorderColor;
            LoginSeperator.Bounds = new RectangleF( 0, 0, 0, 1 );
            LoginSeperator.AddAsSubview( View.PlatformNativeObject );

            SkipButton = PlatformButton.Create( );
            SkipButton.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Large_FontSize );
            SkipButton.TextColor = 0xCCCCCCFF;
            SkipButton.Text = OOBEStrings.SkipAccount;
            SkipButton.Opacity = 0;
            SkipButton.SizeToFit( );
            SkipButton.ClickEvent = (PlatformButton button ) =>
                {
                    onClick( 2 );
                };
            SkipButton.AddAsSubview( View.PlatformNativeObject );

            stream = Rock.Mobile.IO.AssetConvert.AssetToStream( logoImageName );
            stream.Position = 0;
            ImageLogo = PlatformImageView.Create( true );
            ImageLogo.AddAsSubview( View.PlatformNativeObject );
            ImageLogo.Image = stream;
            ImageLogo.SizeToFit( );
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            stream.Dispose( );

            State = OOBE_State.Startup;
        }
예제 #6
0
파일: UIOOBE.cs 프로젝트: jhawkzz/CCVApp
        void EnterNextState( OOBE_State nextState )
        {
            switch( nextState )
            {
                case OOBE_State.Startup:
                {
                    PerformStartup( );
                    break;
                }

                case OOBE_State.Welcome:
                {
                    PerformWelcome( );
                    break;
                }

                case OOBE_State.RevealControls:
                {
                    PerformRevealControls( );
                    break;
                }

                case OOBE_State.Done:
                {
                    break;
                }
            }

            State = nextState;
        }