Ejemplo n.º 1
0
        public void Create( object masterView, string backgroundImageName, string logoImageName, bool scaleImage, RectangleF frame, OnCompletion onCompletion )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = 0;
            View.AddAsSubview( masterView );

            ImageBG = PlatformImageView.Create( true );
            ImageBG.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            ImageBG.AddAsSubview( masterView );

            // if a background image was provided, use that.
            if ( string.IsNullOrEmpty( backgroundImageName ) == false )
            {
                MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream( backgroundImageName );
                stream.Position = 0;
                ImageBG.Image = stream;
                ImageBG.SizeToFit( );
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
                stream.Dispose( );
            }

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream( logoImageName );
            logoStream.Position = 0;
            ImageLogo = PlatformImageView.Create( scaleImage );
            ImageLogo.AddAsSubview( masterView );
            ImageLogo.Image = logoStream;
            ImageLogo.SizeToFit( );
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            OnCompletionCallback = onCompletion;
        }
Ejemplo n.º 2
0
 public static ImageView AsImageView(this PlatformImageView imageView)
 {
     return(new ImageView()
     {
         PlatformView = imageView
     });
 }
Ejemplo n.º 3
0
        public void Create(object masterView, bool scaleImage, string imageName, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame           = frame;
            View.AddAsSubview(masterView);

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(imageName);

            logoStream.Position = 0;
            PonyImage           = PlatformImageView.Create( );
            PonyImage.AddAsSubview(View.PlatformNativeObject);
            PonyImage.Image          = logoStream;
            PonyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview(View.PlatformNativeObject);
            CloseButton.Text            = "Prance! Dance! It's Magic Pony Time!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor       = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button)
            {
                OnCompletionCallback( );
            };

            OnCompletionCallback = onCompletion;
        }
Ejemplo n.º 4
0
        public void Create(object masterView, string backgroundImageName, string logoImageName, bool scaleImage, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = 0;
            View.AddAsSubview(masterView);

            ImageBG = PlatformImageView.Create( );
            ImageBG.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            ImageBG.AddAsSubview(masterView);

            // if a background image was provided, use that.
            if (string.IsNullOrEmpty(backgroundImageName) == false)
            {
                MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream(backgroundImageName);
                stream.Position        = 0;
                ImageBG.Image          = stream;
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
                stream.Dispose( );
            }

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(logoImageName);

            logoStream.Position = 0;
            ImageLogo           = PlatformImageView.Create( );
            ImageLogo.AddAsSubview(masterView);
            ImageLogo.Image          = logoStream;
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            OnCompletionCallback = onCompletion;
        }
Ejemplo n.º 5
0
            public Credit(string message, string image, bool scaleImage, RectangleF frame, PlatformView parent)
            {
                MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(image);

                logoStream.Position = 0;
                Image = PlatformImageView.Create( );
                Image.AddAsSubview(parent.PlatformNativeObject);
                Image.Image          = logoStream;
                Image.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
                logoStream.Dispose( );

                Label                 = PlatformLabel.Create( );
                Label.Text            = message;
                Label.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
                Label.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
                Label.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;
                Label.TextColor       = ControlStylingConfig.Label_TextColor;
                Label.Bounds          = new RectangleF(0, 0, frame.Width * .75f, 0);
                Label.SizeToFit( );
                Label.AddAsSubview(parent.PlatformNativeObject);
            }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
0
        public void Create(object masterView, RectangleF frame, OnButtonClick onJoinClicked)
        {
            OnButtonClicked = onJoinClicked;

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

            // Group Title
            GroupTitle = PlatformLabel.Create( );
            GroupTitle.AddAsSubview(masterView);
            GroupTitle.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize);
            GroupTitle.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            GroupTitle.TextAlignment = TextAlignment.Center;

            // Meeting Time
            MeetingTime = PlatformLabel.Create( );
            MeetingTime.AddAsSubview(masterView);
            MeetingTime.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            MeetingTime.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            MeetingTime.TextAlignment = TextAlignment.Center;

            // Childcare Provided
            ChildcareProvided = PlatformLabel.Create( );
            ChildcareProvided.AddAsSubview(masterView);
            ChildcareProvided.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            ChildcareProvided.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            ChildcareProvided.TextAlignment = TextAlignment.Center;

            // Young Adults
            YoungAdults = PlatformLabel.Create( );
            YoungAdults.AddAsSubview(masterView);
            YoungAdults.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            YoungAdults.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            YoungAdults.TextAlignment = TextAlignment.Center;



            // Family Image and Layer
            FamilyImageLayer = PlatformView.Create( );
            FamilyImageLayer.AddAsSubview(masterView);
            FamilyImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            FamilyImageLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            FamilyImageLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            FamilyImage = PlatformImageView.Create( );
            FamilyImage.AddAsSubview(masterView);
            FamilyImage.ImageScaleType  = PlatformImageView.ScaleType.ScaleAspectFit;
            FamilyImage.BackgroundColor = 0;


            // Group Desc
            GroupDescLayer = PlatformView.Create( );
            GroupDescLayer.AddAsSubview(masterView);
            GroupDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            GroupDescLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            GroupDescLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            GroupDesc = PlatformLabel.Create( );
            GroupDesc.AddAsSubview(masterView);
            GroupDesc.TextAlignment = TextAlignment.Center;
            GroupDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            GroupDesc.TextColor = ControlStylingConfig.TextField_ActiveTextColor;

            // Group Desc Header
            GroupDescHeader = PlatformLabel.Create( );
            GroupDescHeader.AddAsSubview(masterView);
            GroupDescHeader.TextAlignment = TextAlignment.Center;
            GroupDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize);
            GroupDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor;
            GroupDescHeader.Text      = ConnectStrings.GroupInfo_AboutGroup;


            // Childcare Desc
            ChildDescLayer = PlatformView.Create( );
            ChildDescLayer.AddAsSubview(masterView);
            ChildDescLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            ChildDescLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            ChildDescLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            ChildDesc = PlatformLabel.Create( );
            ChildDesc.AddAsSubview(masterView);
            ChildDesc.SetFont(ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize);
            ChildDesc.TextColor     = ControlStylingConfig.TextField_ActiveTextColor;
            ChildDesc.TextAlignment = TextAlignment.Center;

            // Child Desc Header
            ChildDescHeader = PlatformLabel.Create( );
            ChildDescHeader.AddAsSubview(masterView);
            ChildDescHeader.TextAlignment = TextAlignment.Center;
            ChildDescHeader.SetFont(ControlStylingConfig.Font_Bold, ControlStylingConfig.Medium_FontSize);
            ChildDescHeader.TextColor = ControlStylingConfig.TextField_ActiveTextColor;
            ChildDescHeader.Text      = ConnectStrings.GroupInfo_AboutChildcare;


            // Group Image and Layer
            GroupImageLayer = PlatformView.Create( );
            GroupImageLayer.AddAsSubview(masterView);
            GroupImageLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            GroupImageLayer.BorderColor     = ControlStylingConfig.BG_Layer_BorderColor;
            GroupImageLayer.BorderWidth     = ControlStylingConfig.BG_Layer_BorderWidth;

            GroupImage = PlatformImageView.Create( );
            GroupImage.AddAsSubview(masterView);
            GroupImage.ImageScaleType  = PlatformImageView.ScaleType.ScaleAspectFit;
            GroupImage.BackgroundColor = 0;


            // Join Button
            JoinButton = PlatformButton.Create( );
            JoinButton.AddAsSubview(masterView);
            JoinButton.ClickEvent      = JoinClicked;
            JoinButton.BackgroundColor = ControlStylingConfig.Button_BGColor;
            JoinButton.TextColor       = ControlStylingConfig.Button_TextColor;
            JoinButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            JoinButton.Text            = ConnectStrings.JoinGroup_JoinButtonLabel;
            JoinButton.SizeToFit( );
            JoinButton.UserInteractionEnabled = true;

            // Create our results view overlay
            ResultView = new UIResultView(masterView, View.Frame, OnResultViewDone);

            // Create our blocker view
            BlockerView = new UIBlockerView(masterView, View.Frame);
        }