public UIBlockerView( object parentView, RectangleF bounds )
        {
            // setup the fullscreen blocker view
            View = PlatformView.Create( );
            View.AddAsSubview( parentView );
            View.UserInteractionEnabled = false;
            View.BackgroundColor = 0x000000FF;

            // and the busy indicator
            BusyIndicator = PlatformBusyIndicator.Create( );
            BusyIndicator.AddAsSubview( parentView );

            BusyIndicator.Color = 0x999999FF;
            BusyIndicator.BackgroundColor = 0;

            // default to hidden
            SetOpacity( 0.00f );

            SetBounds( bounds );
        }
Beispiel #2
0
        public UIBlockerView(object parentView, RectangleF bounds)
        {
            // setup the fullscreen blocker view
            View = PlatformView.Create( );
            View.AddAsSubview(parentView);
            View.UserInteractionEnabled = false;
            View.BackgroundColor        = 0x000000FF;

            // and the busy indicator
            BusyIndicator = PlatformBusyIndicator.Create( );
            BusyIndicator.AddAsSubview(parentView);

            BusyIndicator.Color           = 0x999999FF;
            BusyIndicator.BackgroundColor = 0;

            // default to hidden
            SetOpacity(0.00f);

            SetBounds(bounds);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

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

            // and the busy indicator
            BusyIndicator                 = PlatformBusyIndicator.Create( );
            BusyIndicator.Color           = 0x999999FF;
            BusyIndicator.BackgroundColor = 0;
            BusyIndicator.Opacity         = 0;
            BusyIndicator.AddAsSubview(View);

            // setup the header label
            HeaderLabel = new UILabel( );
            View.AddSubview(HeaderLabel);
            Theme.StyleLabel(HeaderLabel, Config.Instance.VisualSettings.LabelStyle);
            HeaderLabel.Font = FontManager.GetFont(Settings.General_RegularFont, 32);
            HeaderLabel.Text = "Family Manager";
            HeaderLabel.SizeToFit( );
            HeaderLabel.TextAlignment = UITextAlignment.Center;


            UserNameField = new UIInsetTextField();
            View.AddSubview(UserNameField);

            Theme.StyleTextField(UserNameField, Config.Instance.VisualSettings.TextFieldStyle);
            UserNameField.InputAssistantItem.LeadingBarButtonGroups  = null;
            UserNameField.InputAssistantItem.TrailingBarButtonGroups = null;
            UserNameField.Font = FontManager.GetFont(Settings.General_RegularFont, Config.Instance.VisualSettings.MediumFontSize);
            UserNameField.Layer.AnchorPoint      = CGPoint.Empty;
            UserNameField.AutocorrectionType     = UITextAutocorrectionType.No;
            UserNameField.AutocapitalizationType = UITextAutocapitalizationType.None;
            UserNameField.Placeholder            = "Username";
            UserNameField.ShouldReturn          += (textField) =>
            {
                textField.ResignFirstResponder();

                TryRockBind();
                return(true);
            };

            PasswordField = new UIInsetTextField();
            View.AddSubview(PasswordField);

            Theme.StyleTextField(PasswordField, Config.Instance.VisualSettings.TextFieldStyle);
            PasswordField.InputAssistantItem.LeadingBarButtonGroups  = null;
            PasswordField.InputAssistantItem.TrailingBarButtonGroups = null;
            PasswordField.Layer.AnchorPoint = CGPoint.Empty;
            PasswordField.Font = FontManager.GetFont(Settings.General_RegularFont, Config.Instance.VisualSettings.MediumFontSize);
            PasswordField.AutocorrectionType     = UITextAutocorrectionType.No;
            PasswordField.AutocapitalizationType = UITextAutocapitalizationType.None;
            PasswordField.Placeholder            = "Password";
            PasswordField.SecureTextEntry        = true;

            PasswordField.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();

                TryRockBind();
                return(true);
            };

            // obviously attempt a login if login is pressed
            LoginButton = UIButton.FromType(UIButtonType.System);
            View.AddSubview(LoginButton);

            Theme.StyleButton(LoginButton, Config.Instance.VisualSettings.PrimaryButtonStyle);
            LoginButton.SetTitle("Login", UIControlState.Normal);
            LoginButton.Font = FontManager.GetFont(Settings.General_RegularFont, Config.Instance.VisualSettings.SmallFontSize);
            LoginButton.SizeToFit( );
            LoginButton.Layer.AnchorPoint = CGPoint.Empty;
            LoginButton.TouchUpInside    += (object sender, EventArgs e) =>
            {
                TryRockBind();
            };

            // setup the result
            LoginResult = new UILabel( );
            View.AddSubview(LoginResult);
            Theme.StyleLabel(LoginResult, Config.Instance.VisualSettings.LabelStyle);
            LoginResult.TextAlignment = UITextAlignment.Center;

            // version
            Version = new UILabel();
            Version.Layer.AnchorPoint = CGPoint.Empty;
            Version.TextColor         = UIColor.White;
            Version.TextAlignment     = UITextAlignment.Center;
            Version.Text = Strings.General_Version;
            Theme.StyleLabel(Version, Config.Instance.VisualSettings.LabelStyle);
            Version.Font = Version.Font.WithSize(14);
            View.AddSubview(Version);
        }