public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Prayer_Post, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { if( Success == true ) { // leave ParentTask.OnClick( this, 0 ); } else { // retry SubmitPrayerRequest( ); } } ); BlockerView = new UIBlockerView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) ); return view; }
public override void ViewDidLoad() { base.ViewDidLoad(); // don't allow anything if there isn't a watchUrl set if ( MediaUrl == null ) { throw new Exception( "MediaUrl must not be null!" ); } // setup our activity indicator ActivityIndicator = new UIActivityIndicatorView(); ActivityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; ActivityIndicator.SizeToFit( ); ActivityIndicator.StartAnimating( ); PreloadFinished = false; // create the movie player control MoviePlayer = new MPMoviePlayerController( ); View.AddSubview( MoviePlayer.View ); View.AddSubview( ActivityIndicator ); ResultView = new UIResultView( View, View.Frame.ToRectF( ), delegate { TryPlayMedia( ); } ); }
public override void ViewDidLoad() { base.ViewDidLoad(); ResultView = new UIResultView( View, View.Frame.ToRectF( ), delegate { if( Success == true ) { NavigationController.PopToRootViewController( true ); } else { Task.NavToolbar.Reveal( false ); SubmitPrayerRequest( ); } } ); BlockerView = new UIBlockerView( View, View.Frame.ToRectF( ) ); //setup our appearance View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context ); RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); view.SetBackgroundColor( Android.Graphics.Color.Black ); view.SetOnTouchListener( this ); VideoPlayer = new VideoView( Activity ); VideoPlayer.SetMediaController( MediaController ); VideoPlayer.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent ); ( (RelativeLayout.LayoutParams)VideoPlayer.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); ( ( view as RelativeLayout ) ).AddView( VideoPlayer ); VideoPlayer.SetOnPreparedListener( this ); VideoPlayer.SetOnErrorListener( this ); ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ProgressBar.Indeterminate = true; ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) ); ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); view.AddView( ProgressBar ); ProgressBar.BringToFront(); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { TryPlayMedia( ); } ); return view; }
public override void ViewDidLoad() { base.ViewDidLoad(); // setup the fake header HeaderView = new UIView( ); View.AddSubview( HeaderView ); HeaderView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ); string imagePath = NSBundle.MainBundle.BundlePath + "/" + PrivatePrimaryNavBarConfig.LogoFile_iOS; LogoView = new UIImageView( new UIImage( imagePath ) ); LogoView.Layer.AnchorPoint = CGPoint.Empty; LogoView.SizeToFit( ); HeaderView.AddSubview( LogoView ); ScrollView = new UIScrollViewWrapper(); ScrollView.Frame = new CGRect( View.Frame.Left, HeaderView.Frame.Bottom, View.Frame.Width, View.Frame.Height - HeaderView.Frame.Height ); View.AddSubview( ScrollView ); ScrollView.Parent = this; // logged in sanity check. //if( RockMobileUser.Instance.LoggedIn == true ) throw new Exception("A user cannot be logged in when registering. How did you do this?" ); BlockerView = new UIBlockerView( View, View.Frame.ToRectF( ) ); //setup styles View.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ); UserNameText = new StyledTextField(); ScrollView.AddSubview( UserNameText.Background ); UserNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.None; UserNameText.Field.AutocorrectionType = UITextAutocorrectionType.No; ControlStyling.StyleTextField( UserNameText.Field, RegisterStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( UserNameText.Background ); PasswordText = new StyledTextField(); ScrollView.AddSubview( PasswordText.Background ); PasswordText.Field.AutocapitalizationType = UITextAutocapitalizationType.None; PasswordText.Field.AutocorrectionType = UITextAutocorrectionType.No; PasswordText.Field.SecureTextEntry = true; ControlStyling.StyleTextField( PasswordText.Field, RegisterStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( PasswordText.Background ); ConfirmPasswordText = new StyledTextField(); ScrollView.AddSubview( ConfirmPasswordText.Background ); ConfirmPasswordText.Field.SecureTextEntry = true; ControlStyling.StyleTextField( ConfirmPasswordText.Field, RegisterStrings.ConfirmPasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( ConfirmPasswordText.Background ); NickNameText = new StyledTextField(); ScrollView.AddSubview( NickNameText.Background ); NickNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.Words; NickNameText.Field.AutocorrectionType = UITextAutocorrectionType.No; ControlStyling.StyleTextField( NickNameText.Field, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( NickNameText.Background ); LastNameText = new StyledTextField(); ScrollView.AddSubview( LastNameText.Background ); LastNameText.Field.AutocapitalizationType = UITextAutocapitalizationType.Words; LastNameText.Field.AutocorrectionType = UITextAutocorrectionType.No; ControlStyling.StyleTextField( LastNameText.Field, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( LastNameText.Background ); EmailText = new StyledTextField(); ScrollView.AddSubview( EmailText.Background ); EmailText.Field.AutocapitalizationType = UITextAutocapitalizationType.None; EmailText.Field.AutocorrectionType = UITextAutocorrectionType.No; ControlStyling.StyleTextField( EmailText.Field, RegisterStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( EmailText.Background ); CellPhoneText = new StyledTextField(); ScrollView.AddSubview( CellPhoneText.Background ); CellPhoneText.Field.AutocapitalizationType = UITextAutocapitalizationType.None; CellPhoneText.Field.AutocorrectionType = UITextAutocorrectionType.No; ControlStyling.StyleTextField( CellPhoneText.Field, RegisterStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ControlStyling.StyleBGLayer( CellPhoneText.Background ); DoneButton = UIButton.FromType( UIButtonType.System ); ScrollView.AddSubview( DoneButton ); ControlStyling.StyleButton( DoneButton, RegisterStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); DoneButton.SizeToFit( ); CancelButton = UIButton.FromType( UIButtonType.System ); ScrollView.AddSubview( CancelButton ); CancelButton.SetTitleColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.TextField_PlaceholderTextColor ), UIControlState.Normal ); CancelButton.SetTitle( GeneralStrings.Cancel, UIControlState.Normal ); CancelButton.SizeToFit( ); // Allow the return on username and password to start // the login process NickNameText.Field.ShouldReturn += TextFieldShouldReturn; LastNameText.Field.ShouldReturn += TextFieldShouldReturn; EmailText.Field.ShouldReturn += TextFieldShouldReturn; // If submit is pressed with dirty changes, prompt the user to save them. DoneButton.TouchUpInside += (object sender, EventArgs e) => { RegisterUser( ); HideKeyboard( ); }; // On logout, make sure the user really wants to log out. CancelButton.TouchUpInside += (object sender, EventArgs e) => { // if there were changes, create an action sheet for them to confirm. UIAlertController actionSheet = UIAlertController.Create( RegisterStrings.ConfirmCancelReg, null, UIAlertControllerStyle.ActionSheet ); if( UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad ) { actionSheet.PopoverPresentationController.SourceView = CancelButton; actionSheet.PopoverPresentationController.SourceRect = CancelButton.Bounds; } UIAlertAction yesAction = UIAlertAction.Create( GeneralStrings.Yes, UIAlertActionStyle.Destructive, delegate { Springboard.ResignModelViewController( this, null ); }); actionSheet.AddAction( yesAction ); // let them cancel, too UIAlertAction cancelAction = UIAlertAction.Create( GeneralStrings.Cancel, UIAlertActionStyle.Cancel, delegate { }); actionSheet.AddAction( cancelAction ); PresentViewController( actionSheet, true, null ); }; ResultView = new UIResultView( ScrollView, View.Frame.ToRectF( ), OnResultViewDone ); }
public override void ViewDidLoad() { base.ViewDidLoad(); // setup our table NotesTableView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ); NotesTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; ActivityIndicator = new UIActivityIndicatorView( new CGRect( View.Frame.Width / 2, View.Frame.Height / 2, 0, 0 ) ); ActivityIndicator.StartAnimating( ); ActivityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White; ActivityIndicator.SizeToFit( ); ResultView = new UIResultView( View, View.Frame.ToRectF( ), delegate { TrySetupSeries( ); } ); ResultView.Hide( ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Notes_Primary, container, false); view.SetOnTouchListener( this ); ProgressBar = view.FindViewById<ProgressBar>( Resource.Id.notes_primary_activityIndicator ); ListView = view.FindViewById<ListView>( Resource.Id.notes_primary_list ); ListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e ) => { // we ignore a tap on position 0, because that's the header with Watch/Take Notes if( e.Position > 0 ) { ParentTask.OnClick( this, e.Position - 1 ); } }; ListView.SetOnTouchListener( this ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { TrySetupSeries( ); } ); ResultView.Hide( ); return view; }
public void Create( object masterView, RectangleF frame ) { View = PlatformView.Create( ); View.BackgroundColor = ControlStylingConfig.BackgroundColor; View.AddAsSubview( masterView ); GroupTitle = PlatformLabel.Create( ); GroupTitle.AddAsSubview( masterView ); GroupTitle.SetFont( ControlStylingConfig.Font_Bold, ControlStylingConfig.Large_FontSize ); GroupTitle.TextColor = ControlStylingConfig.TextField_ActiveTextColor; GroupTitle.TextAlignment = TextAlignment.Center; /*GroupDetailsLayer = PlatformView.Create( ); GroupDetailsLayer.AddAsSubview( masterView ); GroupDetailsLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; GroupDetailsLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; GroupDetailsLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth;*/ GroupDetails = PlatformLabel.Create( ); GroupDetails.AddAsSubview( masterView ); GroupDetails.SetFont( ControlStylingConfig.Font_Light, ControlStylingConfig.Medium_FontSize ); GroupDetails.TextColor = ControlStylingConfig.TextField_ActiveTextColor; // Name Info FirstNameLayer = PlatformView.Create( ); FirstNameLayer.AddAsSubview( masterView ); FirstNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; FirstNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; FirstNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; FirstName = PlatformTextField.Create( ); FirstName.AddAsSubview( masterView ); FirstName.SetFont( ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); FirstName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; FirstName.Placeholder = ConnectStrings.JoinGroup_FirstNamePlaceholder; FirstName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; FirstName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; FirstName.AutoCapitalizationType = AutoCapitalizationType.Words; FirstName.AutoCorrectionType = AutoCorrectionType.No; LastNameLayer = PlatformView.Create( ); LastNameLayer.AddAsSubview( masterView ); LastNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; LastNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; LastNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; LastName = PlatformTextField.Create( ); LastName.AddAsSubview( masterView ); LastName.SetFont( ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); LastName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; LastName.Placeholder = ConnectStrings.JoinGroup_LastNamePlaceholder; LastName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; LastName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; LastName.AutoCapitalizationType = AutoCapitalizationType.Words; LastName.AutoCorrectionType = AutoCorrectionType.No; SpouseNameLayer = PlatformView.Create( ); SpouseNameLayer.AddAsSubview( masterView ); SpouseNameLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; SpouseNameLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; SpouseNameLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; SpouseName = PlatformTextField.Create( ); SpouseName.AddAsSubview( masterView ); SpouseName.SetFont( ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); SpouseName.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; SpouseName.Placeholder = ConnectStrings.JoinGroup_SpouseNamePlaceholder; SpouseName.TextColor = ControlStylingConfig.TextField_ActiveTextColor; SpouseName.KeyboardAppearance = KeyboardAppearanceStyle.Dark; SpouseName.AutoCapitalizationType = AutoCapitalizationType.Words; SpouseName.AutoCorrectionType = AutoCorrectionType.No; // Contact Info EmailLayer = PlatformView.Create( ); EmailLayer.AddAsSubview( masterView ); EmailLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; EmailLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; EmailLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; Email = PlatformTextField.Create( ); Email.AddAsSubview( masterView ); Email.SetFont( ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); Email.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; Email.Placeholder = ConnectStrings.JoinGroup_EmailPlaceholder; Email.TextColor = ControlStylingConfig.TextField_ActiveTextColor; Email.KeyboardAppearance = KeyboardAppearanceStyle.Dark; Email.AutoCapitalizationType = AutoCapitalizationType.None; Email.AutoCorrectionType = AutoCorrectionType.No; CellPhoneLayer = PlatformView.Create( ); CellPhoneLayer.AddAsSubview( masterView ); CellPhoneLayer.BackgroundColor = ControlStylingConfig.BG_Layer_Color; CellPhoneLayer.BorderColor = ControlStylingConfig.BG_Layer_BorderColor; CellPhoneLayer.BorderWidth = ControlStylingConfig.BG_Layer_BorderWidth; CellPhone = PlatformTextField.Create( ); CellPhone.AddAsSubview( masterView ); CellPhone.SetFont( ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); CellPhone.PlaceholderTextColor = ControlStylingConfig.TextField_PlaceholderTextColor; CellPhone.Placeholder = ConnectStrings.JoinGroup_CellPhonePlaceholder; CellPhone.TextColor = ControlStylingConfig.TextField_ActiveTextColor; CellPhone.KeyboardAppearance = KeyboardAppearanceStyle.Dark; CellPhone.AutoCapitalizationType = AutoCapitalizationType.None; CellPhone.AutoCorrectionType = AutoCorrectionType.No; // 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 ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Register, container, false); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); view.SetOnTouchListener( this ); RelativeLayout layoutView = view.FindViewById<RelativeLayout>( Resource.Id.scroll_linear_background ); ProgressBarBlocker = view.FindViewById<RelativeLayout>( Resource.Id.progressBarBlocker ); ProgressBarBlocker.Visibility = ViewStates.Gone; ProgressBarBlocker.LayoutParameters = new RelativeLayout.LayoutParams( 0, 0 ); ProgressBarBlocker.LayoutParameters.Width = NavbarFragment.GetFullDisplayWidth( ); ProgressBarBlocker.LayoutParameters.Height = this.Resources.DisplayMetrics.HeightPixels; ResultView = new UIResultView( layoutView, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone ); RelativeLayout navBar = view.FindViewById<RelativeLayout>( Resource.Id.navbar_relative_layout ); navBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); // setup the username UserNameLayer = view.FindViewById<RelativeLayout>( Resource.Id.username_background ); ControlStyling.StyleBGLayer( UserNameLayer ); UserNameText = UserNameLayer.FindViewById<EditText>( Resource.Id.userNameText ); ControlStyling.StyleTextField( UserNameText, RegisterStrings.UsernamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); UserNameBGColor = ControlStylingConfig.BG_Layer_Color; UserNameText.InputType |= InputTypes.TextFlagCapWords; View borderView = UserNameLayer.FindViewById<View>( Resource.Id.username_border ); borderView.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); // password PasswordLayer = view.FindViewById<RelativeLayout>( Resource.Id.password_background ); ControlStyling.StyleBGLayer( PasswordLayer ); PasswordText = PasswordLayer.FindViewById<EditText>( Resource.Id.passwordText ); PasswordText.InputType |= InputTypes.TextVariationPassword; ControlStyling.StyleTextField( PasswordText, RegisterStrings.PasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); PasswordBGColor = ControlStylingConfig.BG_Layer_Color; borderView = PasswordLayer.FindViewById<View>( Resource.Id.password_border ); borderView.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); ConfirmPasswordLayer = view.FindViewById<RelativeLayout>( Resource.Id.confirmPassword_background ); ControlStyling.StyleBGLayer( ConfirmPasswordLayer ); ConfirmPasswordText = ConfirmPasswordLayer.FindViewById<EditText>( Resource.Id.confirmPasswordText ); ConfirmPasswordText.InputType |= InputTypes.TextVariationPassword; ControlStyling.StyleTextField( ConfirmPasswordText, RegisterStrings.ConfirmPasswordPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); ConfirmPasswordBGColor = ControlStylingConfig.BG_Layer_Color; // setup the name section NickNameLayer = view.FindViewById<RelativeLayout>( Resource.Id.firstname_background ); ControlStyling.StyleBGLayer( NickNameLayer ); NickNameText = NickNameLayer.FindViewById<EditText>( Resource.Id.nickNameText ); ControlStyling.StyleTextField( NickNameText, RegisterStrings.NickNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); NickNameBGColor = ControlStylingConfig.BG_Layer_Color; NickNameText.InputType |= InputTypes.TextFlagCapWords; borderView = NickNameLayer.FindViewById<View>( Resource.Id.middle_border ); borderView.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); LastNameLayer = view.FindViewById<RelativeLayout>( Resource.Id.lastname_background ); ControlStyling.StyleBGLayer( LastNameLayer ); LastNameText = LastNameLayer.FindViewById<EditText>( Resource.Id.lastNameText ); ControlStyling.StyleTextField( LastNameText, RegisterStrings.LastNamePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); LastNameBGColor = ControlStylingConfig.BG_Layer_Color; LastNameText.InputType |= InputTypes.TextFlagCapWords; // setup the cell phone section CellPhoneLayer = view.FindViewById<RelativeLayout>( Resource.Id.cellphone_background ); ControlStyling.StyleBGLayer( CellPhoneLayer ); CellPhoneText = CellPhoneLayer.FindViewById<EditText>( Resource.Id.cellPhoneText ); ControlStyling.StyleTextField( CellPhoneText, RegisterStrings.CellPhonePlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); CellPhoneText.AddTextChangedListener(new PhoneNumberFormattingTextWatcher()); // email layer EmailLayer = view.FindViewById<RelativeLayout>( Resource.Id.email_background ); ControlStyling.StyleBGLayer( EmailLayer ); borderView = EmailLayer.FindViewById<View>( Resource.Id.middle_border ); borderView.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_BorderColor ) ); EmailText = EmailLayer.FindViewById<EditText>( Resource.Id.emailAddressText ); ControlStyling.StyleTextField( EmailText, RegisterStrings.EmailPlaceholder, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); EmailBGColor = ControlStylingConfig.BG_Layer_Color; // Register button RegisterButton = view.FindViewById<Button>( Resource.Id.registerButton ); ControlStyling.StyleButton( RegisterButton, RegisterStrings.RegisterButton, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize ); CancelButton = view.FindViewById<Button>( Resource.Id.cancelButton ); ControlStyling.StyleButton( CancelButton, GeneralStrings.Cancel, ControlStylingConfig.Font_Regular, ControlStylingConfig.Small_FontSize ); CancelButton.Background = null; RegisterButton.Click += (object sender, EventArgs e) => { RegisterUser( ); }; CancelButton.Click += (object sender, EventArgs e) => { // Since they made changes, confirm they want to save them. AlertDialog.Builder builder = new AlertDialog.Builder( Activity ); builder.SetTitle( RegisterStrings.ConfirmCancelReg ); Java.Lang.ICharSequence [] strings = new Java.Lang.ICharSequence[] { new Java.Lang.String( GeneralStrings.Yes ), new Java.Lang.String( GeneralStrings.No ) }; builder.SetItems( strings, delegate(object s, DialogClickEventArgs clickArgs) { Rock.Mobile.Threading.Util.PerformOnUIThread( delegate { switch( clickArgs.Which ) { case 0: SpringboardParent.ModalFragmentDone( null ); break; case 1: break; } }); }); builder.Show( ); }; return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } RelativeLayout view = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); view.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); view.SetBackgroundColor( Android.Graphics.Color.Black ); view.SetOnTouchListener( this ); ProgressBar = new ProgressBar( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ProgressBar.Indeterminate = true; ProgressBar.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) ); ProgressBar.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ( (RelativeLayout.LayoutParams)ProgressBar.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); view.AddView( ProgressBar ); // setup our media controller for viewing the position of media MediaController = new MediaController( Rock.Mobile.PlatformSpecific.Android.Core.Context ); MediaController.SetAnchorView( view ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetFullDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { // we know we're bound, so now just retry. ResultView.Hide( ); PlayerState = MediaPlayerState.Preparing; StartAudio( ); SyncUI( ); }); return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView( inflater, container, savedInstanceState ); // get the root control from our .axml var layout = inflater.Inflate(Resource.Layout.Notes, container, false) as RelativeLayout; // get the refresh button from the layout RefreshButton = layout.FindViewById<Button>( Resource.Id.refreshButton ); // create our overridden lockable scroll view ScrollView = new LockableScrollView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ScrollView.ScrollBarStyle = ScrollbarStyles.InsideInset; ScrollView.OverScrollMode = OverScrollMode.Always; ScrollView.VerticalScrollbarPosition = ScrollbarPosition.Default; ScrollView.LayoutParameters = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); ScrollView.Notes = this; ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.CenterHorizontal); ((RelativeLayout.LayoutParams)ScrollView.LayoutParameters).AddRule(LayoutRules.Below, Resource.Id.refreshButton); // add it to our main layout. layout.AddView( ScrollView ); Indicator = layout.FindViewById<ProgressBar>( Resource.Id.progressBar ); Indicator.Visibility = ViewStates.Gone; Indicator.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( 0 ) ); Indicator.BringToFront(); // create the layout that will contain the notes ScrollViewLayout = new RelativeLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); ScrollView.AddView( ScrollViewLayout ); ScrollViewLayout.SetOnTouchListener( this ); RefreshButton.Click += (object sender, EventArgs e ) => { DeleteNote( ); PrepareCreateNotes( ); }; // if the refresh button isn't enabled, hide it if ( App.Shared.Network.RockGeneralData.Instance.Data.DeveloperModeEnabled == false ) { RefreshButton.Visibility = ViewStates.Gone; } // get our power management control PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "Notes"); ResultView = new UIResultView( layout, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), OnResultViewDone ); ResultView.Hide( ); // setup the tutorial overlay TutorialBacker = new View( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TutorialBacker.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); TutorialBacker.Alpha = 0; TutorialBacker.SetBackgroundColor( Android.Graphics.Color.Black ); layout.AddView( TutorialBacker ); AnimatingTutorial = false; TutorialOverlay = new ImageView( Rock.Mobile.PlatformSpecific.Android.Core.Context ); TutorialOverlay.LayoutParameters = new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent ); ((RelativeLayout.LayoutParams)TutorialOverlay.LayoutParameters ).AddRule( LayoutRules.CenterInParent ); TutorialOverlay.Alpha = 0; TutorialOverlay.SetBackgroundColor( Android.Graphics.Color.Transparent ); layout.AddView( TutorialOverlay ); NavBarRevealTracker = new NavBarReveal( ); return layout; }
public override void ViewDidLoad( ) { base.ViewDidLoad( ); OrientationState = -1; UIScrollView = new CustomScrollView(); UIScrollView.Interceptor = this; UIScrollView.Frame = View.Frame; UIScrollView.BackgroundColor = Rock.Mobile.UI.Util.GetUIColor( 0x1C1C1CFF ); UIScrollView.Delegate = new NavBarRevealHelperDelegate( Task.NavToolbar ); UIScrollView.Layer.AnchorPoint = new CGPoint( 0, 0 ); UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(); tapGesture.NumberOfTapsRequired = 2; tapGesture.AddTarget( this, new ObjCRuntime.Selector( "DoubleTapSelector:" ) ); UIScrollView.AddGestureRecognizer( tapGesture ); View.BackgroundColor = UIScrollView.BackgroundColor; View.AddSubview( UIScrollView ); // add a busy indicator Indicator = new UIActivityIndicatorView( UIActivityIndicatorViewStyle.White ); UIScrollView.AddSubview( Indicator ); // add a refresh button for debugging RefreshButton = UIButton.FromType( UIButtonType.System ); RefreshButton.SetTitle( "Refresh", UIControlState.Normal ); RefreshButton.SizeToFit( ); // if they tap the refresh button, refresh the list RefreshButton.TouchUpInside += (object sender, EventArgs e ) => { DeleteNote( ); PrepareCreateNotes( 0, true ); }; ResultView = new UIResultView( UIScrollView, View.Frame.ToRectF( ), OnResultViewDone ); ResultView.Hide( ); // setup the tutorial overlay TutorialBacker = new UIView( ); TutorialBacker.Layer.AnchorPoint = CGPoint.Empty; TutorialBacker.Alpha = 0.00f; TutorialBacker.BackgroundColor = UIColor.Black; TutorialBacker.Hidden = true; View.AddSubview( TutorialBacker ); AnimatingTutorial = false; TutorialOverlay = new UIImageView( ); TutorialOverlay.Layer.AnchorPoint = CGPoint.Empty; TutorialOverlay.Frame = View.Frame; TutorialOverlay.Alpha = 0.00f; View.AddSubview( TutorialOverlay ); KeyboardAdjustManager = new Rock.Mobile.PlatformSpecific.iOS.UI.KeyboardAdjustManager( View ); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout; view.SetOnTouchListener( this ); WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); WebLayout.SetBackgroundColor( Android.Graphics.Color.Black ); view.AddView( WebLayout ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetCurrentContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { ResultView.Hide( ); if ( string.IsNullOrEmpty( Url ) == false ) { ProcessUrl( ); } } ); // get our power management control PowerManager pm = PowerManager.FromContext( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WakeLock = pm.NewWakeLock(WakeLockFlags.Full, "TaskWeb"); return view; }
void LaunchWebview( NSUrl encodedUrl ) { // setup a result view in the case of failure ResultView = new UIResultView( View, View.Bounds.ToRectF( ), delegate { ResultView.Hide( ); ActivityIndicator.Hidden = false; WebView.LoadRequest( new NSUrlRequest( encodedUrl ) ); } ); WebView.LoadRequest( new NSUrlRequest( encodedUrl ) ); // not 100% sure that this is safe. If WebView sets the scrollView delegate and doesn't back ours up // (which it SHOULD) we won't get our calls if ( WebviewControlsNavbar == true ) { WebView.ScrollView.Delegate = new WebScrollDelegate( WebView, Task.NavToolbar ); } }