void RegisterUser() { if (State == RegisterState.None) { // make sure they entered all required fields if (ValidateInput( )) { ToggleControls(false); ProgressBarBlocker.Visibility = ViewStates.Visible; State = RegisterState.Trying; // create a new user and submit them Rock.Client.Person newPerson = new Rock.Client.Person(); // copy all the edited fields into the person object newPerson.Email = EmailText.Text; // set the nickName AND firstName to NickName newPerson.NickName = NickNameText.Text; newPerson.FirstName = NickNameText.Text; newPerson.LastName = LastNameText.Text; MobileAppApi.RegisterNewUser(UserNameText.Text, PasswordText.Text, NickNameText.Text, LastNameText.Text, EmailText.Text, CellPhoneText.Text, delegate(System.Net.HttpStatusCode statusCode, string statusDescription) { ProgressBarBlocker.Visibility = ViewStates.Gone; // scroll to the top so the Result is visible ScrollView.Post(new Action(delegate { ScrollView.ScrollTo(0, 0); })); if (Rock.Mobile.Network.Util.StatusInSuccessRange(statusCode) == true) { ProfileAnalytic.Instance.Trigger(ProfileAnalytic.Register); State = RegisterState.Success; ResultView.Show(RegisterStrings.RegisterStatus_Success, PrivateControlStylingConfig.Result_Symbol_Success, RegisterStrings.RegisterResult_Success, GeneralStrings.Done); } else { State = RegisterState.Fail; ResultView.Show(RegisterStrings.RegisterStatus_Failed, PrivateControlStylingConfig.Result_Symbol_Failed, statusDescription, GeneralStrings.Done); } ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels)); }); } } }
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig) { base.OnConfigurationChanged(newConfig); PrepareCreateNotes( ); ResultView.SetBounds(new System.Drawing.RectangleF(0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels)); AnimateTutorialScreen(false); }
public override void LayoutChanged( ) { base.LayoutChanged( ); // if the layout is changed, the simplest way to fix the UI is to recreate the table source NotesTableView.Source = new TableSource(this, SeriesEntries, ImageMainPlaceholder, ImageThumbPlaceholder); NotesTableView.ReloadData( ); ResultView.SetBounds(View.Bounds.ToRectF( )); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); BlockerView.SetBounds(View.Bounds.ToRectF( )); ResultView.SetBounds(View.Bounds.ToRectF( )); HeaderView.Frame = new CGRect(View.Frame.Left, View.Frame.Top, View.Frame.Width, StyledTextField.StyledFieldHeight); ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height); NickName.SetFrame(new CGRect(-10, View.Frame.Height * .05f, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); LastName.SetFrame(new CGRect(-10, NickName.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); Email.SetFrame(new CGRect(-10, LastName.Background.Frame.Bottom + 20, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); CellPhone.SetFrame(new CGRect(-10, Email.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); Street.SetFrame(new CGRect(-10, CellPhone.Background.Frame.Bottom + 20, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); City.SetFrame(new CGRect(-10, Street.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); State.SetFrame(new CGRect(-10, City.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); Zip.SetFrame(new CGRect(-10, State.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); Gender.SetFrame(new CGRect(-10, Zip.Background.Frame.Bottom + 20, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); GenderButton.Frame = Gender.Background.Frame; Birthdate.SetFrame(new CGRect(-10, Gender.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); BirthdayButton.Frame = Birthdate.Background.Frame; HomeCampus.SetFrame(new CGRect(-10, Birthdate.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); HomeCampusButton.Frame = HomeCampus.Background.Frame; DoneButton.Frame = new CGRect(View.Frame.Left + 10, HomeCampus.Background.Frame.Bottom + 20, View.Bounds.Width - 20, ControlStyling.ButtonHeight); LogoutButton.Frame = new CGRect((View.Frame.Width - ControlStyling.ButtonWidth) / 2, DoneButton.Frame.Bottom + 20, ControlStyling.ButtonWidth, ControlStyling.ButtonHeight); nfloat controlBottom = LogoutButton.Frame.Bottom + (View.Bounds.Height * .25f); ScrollView.ContentSize = new CGSize(0, (nfloat)Math.Max(controlBottom, View.Bounds.Height * 1.05f)); // setup the header shadow UIBezierPath shadowPath = UIBezierPath.FromRect(HeaderView.Bounds); HeaderView.Layer.MasksToBounds = false; HeaderView.Layer.ShadowColor = UIColor.Black.CGColor; HeaderView.Layer.ShadowOffset = new CGSize(0.0f, .0f); HeaderView.Layer.ShadowOpacity = .23f; HeaderView.Layer.ShadowPath = shadowPath.CGPath; if (LogoView != null) { LogoView.Layer.Position = new CoreGraphics.CGPoint((HeaderView.Bounds.Width - LogoView.Bounds.Width) / 2, 0); } BirthdatePicker.LayoutChanged( ); GenderPicker.LayoutChanged( ); GenderPicker.TogglePicker(false, false); BirthdatePicker.TogglePicker(false, false); }
public override void LayoutChanged() { base.LayoutChanged(); WebView.Bounds = View.Bounds; // this could be null if we are waiting for the impersonation token response if (ResultView != null) { ResultView.SetBounds(WebView.Bounds.ToRectF( )); } ActivityIndicator.Frame = new CGRect((View.Bounds.Width - ActivityIndicator.Bounds.Width) / 2, (View.Bounds.Height - ActivityIndicator.Bounds.Height) / 2, ActivityIndicator.Bounds.Width, ActivityIndicator.Bounds.Height); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); HeaderView.Frame = new CGRect(View.Frame.Left, View.Frame.Top, View.Frame.Width, StyledTextField.StyledFieldHeight); ScrollView.Frame = new CGRect(View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height); UserNameText.SetFrame(new CGRect(-10, View.Frame.Height * .05f, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); PasswordText.SetFrame(new CGRect(-10, UserNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); ConfirmPasswordText.SetFrame(new CGRect(-10, PasswordText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); NickNameText.SetFrame(new CGRect(-10, ConfirmPasswordText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); LastNameText.SetFrame(new CGRect(-10, NickNameText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); EmailText.SetFrame(new CGRect(-10, LastNameText.Background.Frame.Bottom + 40, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); CellPhoneText.SetFrame(new CGRect(-10, EmailText.Background.Frame.Bottom, View.Frame.Width + 20, StyledTextField.StyledFieldHeight)); DoneButton.Frame = new CGRect(View.Frame.Left + 10, CellPhoneText.Background.Frame.Bottom + 20, View.Bounds.Width - 20, ControlStyling.ButtonHeight); CancelButton.Frame = new CGRect((View.Frame.Width - ControlStyling.ButtonWidth) / 2, DoneButton.Frame.Bottom + 20, ControlStyling.ButtonWidth, ControlStyling.ButtonHeight); // for the scroll size, if the content is larger than the screen, we'll take the bottom // of the content plus some padding. Otherwise, we'll just use the window height plus a tiny bit so there's // a subtle scroll effect nfloat controlBottom = CancelButton.Frame.Bottom + (View.Bounds.Height * .25f); ScrollView.ContentSize = new CGSize(0, (nfloat)Math.Max(controlBottom, View.Bounds.Height * 1.05f)); // setup the header shadow UIBezierPath shadowPath = UIBezierPath.FromRect(HeaderView.Bounds); HeaderView.Layer.MasksToBounds = false; HeaderView.Layer.ShadowColor = UIColor.Black.CGColor; HeaderView.Layer.ShadowOffset = new CGSize(0.0f, .0f); HeaderView.Layer.ShadowOpacity = .23f; HeaderView.Layer.ShadowPath = shadowPath.CGPath; if (LogoView != null) { LogoView.Layer.Position = new CoreGraphics.CGPoint((HeaderView.Bounds.Width - LogoView.Bounds.Width) / 2, 0); } ResultView.SetBounds(View.Frame.ToRectF( )); BlockerView.SetBounds(View.Frame.ToRectF( )); }
public override void LayoutChanged( ) { base.LayoutChanged( ); // get the orientation state. WE consider unknown- 1, profile 0, landscape 1, int orientationState = SpringboardViewController.IsDeviceLandscape( ) == true ? 1 : 0; // if the states are in disagreement, correct it if (OrientationState != orientationState) { OrientationState = orientationState; BibleWebView.Frame = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height); BibleWebView.Layer.Position = new CGPoint(BibleWebView.Layer.Position.X, BibleWebView.Layer.Position.Y); BlockerView.SetBounds(View.Bounds.ToRectF( )); ResultView.SetBounds(View.Bounds.ToRectF( )); } }
public void LayoutChanged(RectangleF containerBounds) { View.Frame = new RectangleF(containerBounds.Left, containerBounds.Top, containerBounds.Width, containerBounds.Height); BlockerView.SetBounds(containerBounds); ResultView.SetBounds(containerBounds); float sectionSpacing = Rock.Mobile.Graphics.Util.UnitToPx(25); float layerHeight = Rock.Mobile.Graphics.Util.UnitToPx(44); float textFieldHeight = Rock.Mobile.Graphics.Util.UnitToPx(40); float textLeftInset = Rock.Mobile.Graphics.Util.UnitToPx(10); float textTopInset = Rock.Mobile.Graphics.Util.UnitToPx(2); float buttonWidth = Rock.Mobile.Graphics.Util.UnitToPx(122); GroupTitle.Frame = new RectangleF(0, 0, View.Frame.Width, GroupTitle.Frame.Height); GroupDetails.Frame = new RectangleF(0, GroupTitle.Frame.Bottom, View.Frame.Width, Rock.Mobile.Graphics.Util.UnitToPx(60)); //GroupDetailsLayer.Frame = new RectangleF( 0, GroupTitle.Frame.Bottom, View.Frame.Width, Rock.Mobile.Graphics.Util.UnitToPx( 62 ) ); // Name Info FirstNameLayer.Frame = new RectangleF(0, GroupDetails.Frame.Bottom + sectionSpacing, View.Frame.Width, layerHeight); FirstName.Frame = new RectangleF(textLeftInset, FirstNameLayer.Frame.Top + textTopInset, View.Frame.Width, textFieldHeight); LastNameLayer.Frame = new RectangleF(0, FirstNameLayer.Frame.Bottom, View.Frame.Width, layerHeight); LastName.Frame = new RectangleF(textLeftInset, LastNameLayer.Frame.Top + textTopInset, View.Frame.Width, textFieldHeight); SpouseNameLayer.Frame = new RectangleF(0, LastNameLayer.Frame.Bottom, View.Frame.Width, layerHeight); SpouseName.Frame = new RectangleF(textLeftInset, SpouseNameLayer.Frame.Top + textTopInset, View.Frame.Width, textFieldHeight); // Contact Info EmailLayer.Frame = new RectangleF(0, SpouseNameLayer.Frame.Bottom + sectionSpacing, View.Frame.Width, layerHeight); Email.Frame = new RectangleF(textLeftInset, EmailLayer.Frame.Top + textTopInset, View.Frame.Width, textFieldHeight); CellPhoneLayer.Frame = new RectangleF(0, EmailLayer.Frame.Bottom, View.Frame.Width, layerHeight); CellPhone.Frame = new RectangleF(textLeftInset, CellPhoneLayer.Frame.Top + textTopInset, View.Frame.Width, textFieldHeight); // Join Button JoinButton.Frame = new RectangleF((View.Frame.Width - buttonWidth) / 2, CellPhoneLayer.Frame.Bottom + sectionSpacing, buttonWidth, layerHeight); }
public void LayoutChanged(RectangleF containerBounds) { View.Frame = new RectangleF(containerBounds.Left, containerBounds.Top, containerBounds.Width, containerBounds.Height); BlockerView.SetBounds(containerBounds); ResultView.SetBounds(containerBounds); if (IsDownloading == false) { float sectionSpacing = Rock.Mobile.Graphics.Util.UnitToPx(25); float textLeftInset = Rock.Mobile.Graphics.Util.UnitToPx(10); float textTopInset = Rock.Mobile.Graphics.Util.UnitToPx(2); float textRightInset = textLeftInset * 2; float textBotInset = textTopInset * 2; float buttonWidth = Rock.Mobile.Graphics.Util.UnitToPx(122); float buttonHeight = Rock.Mobile.Graphics.Util.UnitToPx(44); GroupTitle.Hidden = false; GroupTitle.Frame = new RectangleF(textLeftInset, 0, View.Frame.Width - textRightInset, 0); GroupTitle.SizeToFit( ); GroupTitle.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupTitle.Bounds.Height); // layout the meeting itme MeetingTime.Hidden = false; MeetingTime.Frame = new RectangleF(textLeftInset, GroupTitle.Frame.Bottom, View.Frame.Width - textRightInset, 0); MeetingTime.SizeToFit( ); MeetingTime.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, MeetingTime.Bounds.Height); float nextYPos = MeetingTime.Frame.Bottom; // layout the childcare banner if (string.IsNullOrWhiteSpace(ChildcareProvided.Text) == false) { ChildcareProvided.Hidden = false; ChildcareProvided.Frame = new RectangleF(textLeftInset, nextYPos, View.Frame.Width - textRightInset, 0); ChildcareProvided.SizeToFit( ); ChildcareProvided.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildcareProvided.Bounds.Height); nextYPos = ChildcareProvided.Frame.Bottom; } else { ChildcareProvided.Hidden = true; } // layout the young adults banner if (string.IsNullOrWhiteSpace(YoungAdults.Text) == false) { YoungAdults.Hidden = false; YoungAdults.Frame = new RectangleF(textLeftInset, nextYPos, View.Frame.Width - textRightInset, 0); YoungAdults.SizeToFit( ); YoungAdults.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, YoungAdults.Bounds.Height); nextYPos = YoungAdults.Frame.Bottom; } else { YoungAdults.Hidden = true; } nextYPos += sectionSpacing; // layout the group description header (IF there's a description or group photo) if (string.IsNullOrWhiteSpace(GroupDesc.Text) == false || FamilyImageValid == true) { // display and position the header GroupDescHeader.Hidden = false; GroupDescHeader.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); GroupDescHeader.SizeToFit( ); GroupDescHeader.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupDescHeader.Bounds.Height); nextYPos = GroupDescHeader.Frame.Bottom; // now try the image if (FamilyImageValid == true) { // setup padding for the image float imageTopPadding = textTopInset * 2; float imageBotPadding = textBotInset * 2; float leaderImageLayerHeight = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Leader_ImageSize); FamilyImage.Hidden = false; FamilyImage.Position = new PointF((View.Frame.Width - FamilyImage.Frame.Width) / 2, nextYPos + imageTopPadding); FamilyImageLayer.Hidden = false; FamilyImageLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, leaderImageLayerHeight + imageBotPadding); nextYPos = FamilyImageLayer.Frame.Bottom + sectionSpacing; } // try to layout the group description if (string.IsNullOrWhiteSpace(GroupDesc.Text) == false) { GroupDesc.Hidden = false; GroupDesc.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); GroupDesc.SizeToFit( ); GroupDesc.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, GroupDesc.Bounds.Height); GroupDescLayer.Hidden = false; GroupDescLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, GroupDesc.Frame.Height + textBotInset); nextYPos = GroupDescLayer.Frame.Bottom + textBotInset + sectionSpacing; } // now try the image if (GroupImageValid == true) { // setup padding for the image float imageTopPadding = textTopInset * 2; float imageBotPadding = textBotInset * 2; float groupImageLayerHeight = Rock.Mobile.Graphics.Util.UnitToPx(PrivateConnectConfig.GroupInfo_Group_ImageSize); GroupImage.Hidden = false; GroupImage.Position = new PointF((View.Frame.Width - GroupImage.Frame.Width) / 2, nextYPos + imageTopPadding); GroupImageLayer.Hidden = false; GroupImageLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, groupImageLayerHeight + imageBotPadding); nextYPos = GroupImageLayer.Frame.Bottom + sectionSpacing; } // regardless of which (or both) of the above displayed, add an additional sectionSpacing // so that the next major section, ChildDesc, has more spacing. nextYPos += sectionSpacing; } // layout the child info header if (string.IsNullOrWhiteSpace(ChildDesc.Text) == false) { ChildDescHeader.Hidden = false; ChildDescHeader.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); ChildDescHeader.SizeToFit( ); ChildDescHeader.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildDescHeader.Bounds.Height); nextYPos = ChildDescHeader.Frame.Bottom; // layout child info ChildDesc.Hidden = false; ChildDesc.Frame = new RectangleF(textLeftInset, nextYPos + textTopInset, View.Frame.Width - textRightInset, 0); ChildDesc.SizeToFit( ); ChildDesc.Bounds = new RectangleF(0, 0, View.Frame.Width - textRightInset, ChildDesc.Bounds.Height); ChildDescLayer.Hidden = false; ChildDescLayer.Frame = new RectangleF(0, nextYPos, View.Frame.Width, ChildDesc.Frame.Height + textBotInset); nextYPos = ChildDescLayer.Frame.Bottom + sectionSpacing; } // Join Button JoinButton.Hidden = false; JoinButton.Frame = new RectangleF((View.Frame.Width - buttonWidth) / 2, nextYPos + sectionSpacing, buttonWidth, buttonHeight); } }