protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RequestQuotation); SetTitleBack(); textBuyPolice = FindViewById <TextView>(Resource.Id.textBuyPolice); textBenefits = FindViewById <TextView>(Resource.Id.textBenefits); textQuarterlyPolicy = FindViewById <TextView>(Resource.Id.textQuarterlyPolicy); textDiscounts = FindViewById <TextView>(Resource.Id.textDiscounts); textBonuses = FindViewById <TextView>(Resource.Id.textBonuses); textSettlement = FindViewById <TextView>(Resource.Id.textSettlement); textHelp = FindViewById <TextView>(Resource.Id.textHelp); editSurname = FindViewById <TextInputLayout>(Resource.Id.editSurname); editName = FindViewById <TextInputLayout>(Resource.Id.editName); editMark = FindViewById <TextInputLayout>(Resource.Id.editMark); editModel = FindViewById <TextInputLayout>(Resource.Id.editModel); editYear = FindViewById <TextInputLayout>(Resource.Id.editYear); editRegistrationNumber = FindViewById <TextInputLayout>(Resource.Id.editRegistrationNumber); buttonSendRequest = FindViewById <Button>(Resource.Id.buttonSendRequest); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.Fragment3, container, false); //Reference Input fields and button mTilBitcoin = view.FindViewById <TextInputLayout>(Resource.Id.intInputLayoutBitcoin); mTilSEK = view.FindViewById <TextInputLayout>(Resource.Id.intInputLayoutSEK); Button btnConvert = view.FindViewById <Button>(Resource.Id.btnConvert); //Enter Default values in edittext fields mTilBitcoin.EditText.Text = "0"; mTilSEK.EditText.Text = "0"; //Creating WebClient and Url path; WebClient webclient = new WebClient(); Stream stream = webclient.OpenRead("http://api.coindesk.com/v1/bpi/currentprice/sek.json"); StreamReader reader = new StreamReader(stream); //Open Stream to bitcoin sek rate api and get json Newtonsoft.Json.Linq.JObject jObject = Newtonsoft.Json.Linq.JObject.Parse(reader.ReadLine()); stream.Close(); //Extract exangerate data from json rate = (double)jObject["bpi"]["SEK"]["rate_float"]; //Subscribing Button click event to function; btnConvert.Click += BtnConvert_Click; return(view); }
protected override void InitializeViews() { signUpEmailLabel = FindViewById <TextInputLayout>(Resource.Id.SignUpEmail); signUpPasswordLabel = FindViewById <TextInputLayout>(Resource.Id.SignUpPassword); loginCard = FindViewById(Resource.Id.LoginSignupCardView); errorTextView = FindViewById <TextView>(Resource.Id.SignUpError); countryNameTextView = FindViewById <TextView>(Resource.Id.SignUpCountryName); signUpOrLabel = FindViewById <TextView>(Resource.Id.SignUpOrLabel); signUpWithGoogleLabel = FindViewById <TextView>(Resource.Id.SignUpWithGoogleLabel); alreadyHaveAnAccountLabel = FindViewById <TextView>(Resource.Id.AlreadyHaveAnAccountLabel); loginLabel = FindViewById <TextView>(Resource.Id.LoginLabel); countrySelection = FindViewById <LinearLayout>(Resource.Id.SignUpCountrySelection); signupButton = FindViewById <Button>(Resource.Id.SignUpButton); googleSignupButton = FindViewById <View>(Resource.Id.SignUpWithGoogleButton); progressBar = FindViewById <ProgressBar>(Resource.Id.SignUpProgressBar); emailEditText = FindViewById <EditText>(Resource.Id.SignUpEmailEditText); passwordEditText = FindViewById <EditText>(Resource.Id.SignUpPasswordEditText); countryErrorView = FindViewById <ImageView>(Resource.Id.SignUpCountryErrorView); signUpEmailLabel.Hint = Shared.Resources.Email; signUpPasswordLabel.Hint = Shared.Resources.Password; signUpOrLabel.Text = Shared.Resources.Or; signUpWithGoogleLabel.Text = Shared.Resources.GoogleSignUp; alreadyHaveAnAccountLabel.Text = Shared.Resources.AlreadyHaveAnAccountQuestionMark; loginLabel.Text = Shared.Resources.LoginTitle; signupButton.Text = Shared.Resources.SignUpTitle; }
private void EditName(object sender, EventArgs e) { _editText = (TextInputLayout)LayoutInflater.Inflate(Resource.Layout.edit_name, null); _editText.EditText.Text = Vm.Debt.Name; _editText.EditText.Gravity = Android.Views.GravityFlags.Center; using (var alert = new AlertDialog.Builder(MainActivity.Current)) { alert.SetView(_editText) .SetPositiveButton(Resource.String.save, (s, ev) => { }) .SetNeutralButton(Resource.String.cancel, (s, ev) => { HideKeyboard(); }) .SetOnDismissListener(this); _dialog = alert.Create(); } _dialog.Show(); _dialogPositiveButton = _dialog.GetButton((int)DialogButtonType.Positive); _dialogNegativeButton = _dialog.GetButton((int)DialogButtonType.Neutral); _dialogPositiveButton.Click += HandleDialogPositiveButtonClick; _dialogNegativeButton.Click += HandleDialogNegativeButtonClick; _editText.EditText.TextChanged += OnTextChanged; _editText.RequestFocus(); ShowKeyboard(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.clientes_Nuevo); db = new SQLite.SQLiteConnection(sqlPath); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarNuevoCliente); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.Title = "Nuevo Cliente"; textNombre = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteNombre); textApellidoPaterno = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteApellidoPaterno); textApellidoMaterno = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteApellidoMaterno); textEmail = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteEmailFacturacion); textTelefono2 = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteTelefono2); textTelefono1 = FindViewById <TextInputLayout>(Resource.Id.textNuevoClienteTelefono1); spinnerIdiomas = FindViewById <Spinner>(Resource.Id.spinnerNuevoClienteIdioma); spinnerPaises = FindViewById <Spinner>(Resource.Id.spinnerNuevoClientePais); //var direcciones = db.Table<MDomicilio>().ToList(); //List<string> domicilioSpinner = direcciones.Select(x => x.DireccionCompleta).ToList(); ///ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, domicilioSpinner); //spinnerDirecciones.Adapter = adapter; int indexIdioma = loadIdiomas(); int indexPaises = loadPaises(); spinnerIdiomas.SetSelection(indexIdioma); spinnerPaises.SetSelection(indexPaises); botonGuardar = FindViewById <Button>(Resource.Id.botonGuardarNuevoCliente); botonGuardar.Click += BotonGuardar_Click; }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); var postToggleBtn = view.FindViewById <MaterialButtonToggleGroup>(Resource.Id.photo_choser_togglegrp); postImageView = view.FindViewById <ImageView>(Resource.Id.image_to_post); profile_image_view = view.FindViewById <CircleImageView>(Resource.Id.create_post_userProfile); commentEt = view.FindViewById <TextInputLayout>(Resource.Id.create_post_et); doneBtn = view.FindViewById <MaterialButton>(Resource.Id.done_btn); postProgress = view.FindViewById <ProgressBar>(Resource.Id.post_progress); closeBtn = view.FindViewById <ImageButton>(Resource.Id.post_cancel_btn); closeBtn.Click += CloseBtn_Click; postToggleBtn.AddOnButtonCheckedListener(new ButtonCheckedListener( onbuttonChecked: (g, id, isChecked) => { if (isChecked) { switch (id) { case Resource.Id.open_cam_btn: icu.TakeCameraImage(); break; case Resource.Id.choose_photo_btn: icu.FetchImageFromGallery(); break; } } })); doneBtn.Click += DoneBtn_Click; commentEt.EditText.TextChanged += EditText_TextChanged; Glide.With(this).SetDefaultRequestOptions(requestOptions).Load(profile_url).Into(profile_image_view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment View view = inflater.Inflate(Resource.Layout.addexam, container, false); addexamnameText = (TextInputLayout)view.FindViewById(Resource.Id.addexamnameText); addexamdateText = (TextInputLayout)view.FindViewById(Resource.Id.addexamdateText); submitButton = (Button)view.FindViewById(Resource.Id.submitButton); submitButton.Click += async(sender, e) => { ExamModel model = new ExamModel(); model.examName = addexamnameText.EditText.Text; model.date = (Firebase.Timestamp)addexamdateText.EditText.Text; await CrossCloudFirestore.Current .Instance .Collection("exams") .Document(addexamnameText.EditText.Text) .SetAsync(model); this.Dismiss(); }; return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.SignUpFragment, container, false); Button btnSignUp = view.FindViewById <Button>(Resource.Id.btnSignUp); TextView registerMessage = view.FindViewById <TextView>(Resource.Id.register_message); TextInputLayout passwordWrapper = view.FindViewById <TextInputLayout>(Resource.Id.signUpPassword); TextInputLayout confirmPasswordWrapper = view.FindViewById <TextInputLayout>(Resource.Id.signUpConfirmPassword); TextInputLayout emailWrapper = view.FindViewById <TextInputLayout>(Resource.Id.signUpEmail); btnSignUp.Click += (o, e) => { string txtPassword = passwordWrapper.EditText.Text; string txtConfirmPassword = confirmPasswordWrapper.EditText.Text; string txtEmail = emailWrapper.EditText.Text; try { RestService.SignUp(txtEmail, txtPassword); registerMessage.Text = "You've succesfully signed up!"; } catch (WebException ex) { passwordWrapper.Error = "Incorrect data"; } }; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.dialog_reset_pass); Window.SetLayout(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); Window.SetGravity(GravityFlags.Center); _header = FindViewById <TextView>(Resource.Id.reset_pass_header); _loginInputLayout = FindViewById <TextInputLayout>(Resource.Id.reset_pass_login_input); _emailInputLayout = FindViewById <TextInputLayout>(Resource.Id.reset_pass_email_input); _loginEditText = FindViewById <AppCompatEditText>(Resource.Id.reset_pass_login_edit_text); _emailEditText = FindViewById <AppCompatEditText>(Resource.Id.reset_pass_email_edit_text); _progressBarContainer = FindViewById <FrameLayout>(Resource.Id.reset_pass_progress_container); _resetPassButton = FindViewById <TextView>(Resource.Id.reset_pass_button); FindViewById <ImageView>(Resource.Id.reset_pass_close).Click += (sender, args) => Dismiss(); _loginEditText.TextChanged += (sender, args) => Validate(); _emailEditText.TextChanged += (sender, args) => Validate(); _emailEditText.EditorAction += (sender, args) => OnPassResetClick(); _resetPassButton.Click += (sender, args) => OnPassResetClick(); ApplyI18N(); if (savedInstanceState != null) { return; } _viewModel.PasswordResetLiveData.Observe(LifecycleManager, OnPasswordReset, e => Log.Error("ResetPassDialog", "Error observing PasswordResetLiveData", e)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.hospedaje_Nuevo); db = new SQLite.SQLiteConnection(sqlPath); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarNuevoHospedaje); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.Title = "Nuevo Hospedaje"; textNombre = FindViewById <TextInputLayout>(Resource.Id.textNuevoHospedajeNombre); textDireccion = FindViewById <TextInputLayout>(Resource.Id.textNuevoHospedajeDireccion); textTelefono2 = FindViewById <TextInputLayout>(Resource.Id.textNuevoHospedajeTelefono2); textTelefono1 = FindViewById <TextInputLayout>(Resource.Id.textNuevoHospedajeTelefono1); spinnerTipo = FindViewById <Spinner>(Resource.Id.spinnerNuevoHospedajeTipos); List <string> tiposSpinner = new List <string>(); tiposSpinner.Add("Hotel"); tiposSpinner.Add("Hostal"); tiposSpinner.Add("Residencial"); tiposSpinner.Add("Motel"); tiposSpinner.Add("Otro"); ArrayAdapter adapter = new ArrayAdapter(this, global::Android.Resource.Layout.SimpleSpinnerDropDownItem, tiposSpinner); spinnerTipo.Adapter = adapter; botonGuardar = FindViewById <Button>(Resource.Id.botonGuardarNuevoHospedaje); botonGuardar.Click += BotonGuardar_Click; }
public EnterConfirmCodeActivity() : base(Resource.Layout.input_confirm_code_layout) { OnLoaded += delegate { // AllowBackNavigation(); // currentInput = Intent.GetStringExtra(InputKey); operation = Intent.GetStringExtra(OperationKey) ?? Phone; TextView lbHint = FindViewById <TextView>(Resource.Id.lb_hint); switch (operation) { case Phone: SupportActionBar.Title = "Confirm Phone"; lbHint.SetHtml(string.Format(BaseContext.GetString(Resource.String.PhoneConfirmMsg), currentInput)); break; case Email: SupportActionBar.Title = "Confirm Email"; lbHint.SetHtml(string.Format(BaseContext.GetString(Resource.String.EmailConfirmMsg), currentInput)); break; } // pgbBusy = FindViewById <ProgressBar>(Resource.Id.pgb_busy); pgbBusy.Visibility = ViewStates.Gone; tbConfirmCode = FindViewById <TextInputLayout>(Resource.Id.tb_confirm_txt); (btnConfirm = FindViewById <Button>(Resource.Id.btn_submit)).Click += OnConfirm; }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = base.OnCreateView(inflater, container, savedInstanceState); SetupToolbar(view, Resource.String.prefPasswordTitle); _preferences = new PreferenceWrapper(Context); _hasPassword = _preferences.PasswordProtected; _progressBar = view.FindViewById <ProgressBar>(Resource.Id.appBarProgressBar); _setPasswordButton = view.FindViewById <MaterialButton>(Resource.Id.buttonSetPassword); _setPasswordButton.Click += OnSetPasswordButtonClick; _passwordText = view.FindViewById <TextInputEditText>(Resource.Id.editPassword); _passwordText.TextChanged += delegate { UpdateSetPasswordButton(); }; _passwordConfirmLayout = view.FindViewById <TextInputLayout>(Resource.Id.editPasswordConfirmLayout); _passwordConfirmText = view.FindViewById <TextInputEditText>(Resource.Id.editPasswordConfirm); TextInputUtil.EnableAutoErrorClear(_passwordConfirmLayout); _passwordConfirmText.EditorAction += (_, e) => { if (_setPasswordButton.Enabled && e.ActionId == ImeAction.Done) { OnSetPasswordButtonClick(null, null); } }; _cancelButton = view.FindViewById <MaterialButton>(Resource.Id.buttonCancel); _cancelButton.Click += delegate { Dismiss(); }; UpdateSetPasswordButton(); return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); newUserButton = (Button)FindViewById(Resource.Id.newUser); signInButton = (Button)FindViewById(Resource.Id.signInButton); loginUsername = (TextInputLayout)FindViewById(Resource.Id.loginusernameWrapper); loginPassword = (TextInputLayout)FindViewById(Resource.Id.loginpasswordWrapper); appImage = (ImageView)FindViewById(Resource.Id.imageIcon); appImage.RequestLayout(); appImage.LayoutParameters.Height = 300; appImage.LayoutParameters.Width = 300; appImage.SetScaleType(ImageView.ScaleType.FitXy); var app = FirebaseApp.InitializeApp(this); InitializeFirebase(); newUserButton.Click += delegate { StartActivity(typeof(RegisterActivity)); Finish(); }; signInButton.Click -= LoginButton_Click; signInButton.Click += LoginButton_Click; loginPassword.HintEnabled = false; loginUsername.HintEnabled = false; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.SignInFragment, container, false); Button btnLogin = view.FindViewById <Button>(Resource.Id.btnLogin); TextView loginMessage = view.FindViewById <TextView>(Resource.Id.login_message); TextInputLayout passwordWrapper = view.FindViewById <TextInputLayout>(Resource.Id.txtInputLayoutPassword); TextInputLayout emailWrapper = view.FindViewById <TextInputLayout>(Resource.Id.txtEmail); btnLogin.Click += (o, e) => { string txtPassword = passwordWrapper.EditText.Text; string txtEmail = emailWrapper.EditText.Text; try { string token = RestService.SignIn(txtEmail, txtPassword); loginMessage.Text = "You've successfully signed in!"; ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Application.Context); ISharedPreferencesEditor editor = prefs.Edit(); editor.PutString("access_token", token); editor.Apply(); } catch (WebException ex) { passwordWrapper.Error = "Incorrect username or password"; } }; return(view); }
//public override bool OnOptionsItemSelected(IMenuItem item) //{ // switch (item.ItemId) // { // case Android.Resource.Id.Home: // Activity.SupportFragmentManager.BeginTransaction().Remove(this).Commit(); // return true; // default: // return base.OnOptionsItemSelected(item); ; // } //} #endregion #region Methods private void GetElements(View view) { diagnosticsBtn = view.FindViewById <Button>(Resource.Id.makeorder_diagnostics_btn); mechanicalBtn = view.FindViewById <Button>(Resource.Id.makeorder_mechanical_btn); bodypaintBtn = view.FindViewById <Button>(Resource.Id.makeorder_bodypaint_btn); extrasBtn = view.FindViewById <Button>(Resource.Id.makeorder_extras_btn); wheelalignBtn = view.FindViewById <Button>(Resource.Id.makeorder_wheelalign_btn); commentBtn = view.FindViewById <Button>(Resource.Id.makeorder_comment_btn); completeBtn = view.FindViewById <Button>(Resource.Id.makeorder_complete_btn); diagnosticsLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_diagnostics); mechanicalLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_mechanical); bodypaintLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_bodypaint); extrasLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_extras); wheelalignLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_wheelalign); commentLayout = view.FindViewById <TextInputLayout>(Resource.Id.makeorder_input_layout_comment); diagnosticsText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_diagnostics_text); mechanicalText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_mechanical_text); bodypaintText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_bodypaint_text); extrasText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_extras_text); wheelalignText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_wheelalign_text); commentText = view.FindViewById <EditTextClearBtn>(Resource.Id.makeorder_comment_text); carName = view.FindViewById <TextView>(Resource.Id.makeorder_car_name); carLeftBtn = view.FindViewById <ImageView>(Resource.Id.makeorder_car_left); carRightBtn = view.FindViewById <ImageView>(Resource.Id.makeorder_car_right); carAva = view.FindViewById <ImageView>(Resource.Id.makerorder_car_ava); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.bomba_singularidade, container, false); // Inputs TextInputLayout comprimentoInput = view.FindViewById <TextInputLayout>(Resource.Id.textInBombaSingularidade); MainActivity main = (MainActivity)this.Activity; // Chequa se o objeto fluido da main activity jah foi criado, se sim copia o valor dele para o fluido privado dessa classe if (main.Singularidade != null) { if (main.Singularidade.ComprimentoEqv != 0) { singularidade = main.Singularidade; comprimentoInput.EditText.Text = singularidade.ComprimentoEqv.ToString(); } } // EventHandler para os inputs comprimentoInput.EditText.TextChanged += ComprimentoTextInputLayout_ChangedText; // Continua com a operação do android var ignored = base.OnCreateView(inflater, container, savedInstanceState); return(view); }
protected override void InitializeViews() { signupCard = FindViewById(Resource.Id.LoginSignupCardView); errorTextView = FindViewById <TextView>(Resource.Id.LoginError); loginButton = FindViewById <Button>(Resource.Id.LoginLoginButton); forgotPasswordView = FindViewById <TextView>(Resource.Id.LoginForgotPassword); orLabel = FindViewById <TextView>(Resource.Id.LoginOrLabel); googleLoginButton = FindViewById <View>(Resource.Id.LoginGoogleLogin); googleLoginLabel = FindViewById <TextView>(Resource.Id.LoginGoogleLoginLabel); haveAnAccountLabel = FindViewById <TextView>(Resource.Id.HaveAnAccountLabel); signUpLabel = FindViewById <TextView>(Resource.Id.SignUpLabel); progressBar = FindViewById <ProgressBar>(Resource.Id.LoginProgressBar); loginEmail = FindViewById <TextInputLayout>(Resource.Id.LoginEmail); emailEditText = FindViewById <EditText>(Resource.Id.LoginEmailEditText); loginPassword = FindViewById <TextInputLayout>(Resource.Id.LoginPassword); passwordEditText = FindViewById <EditText>(Resource.Id.LoginPasswordEditText); loginEmail.Hint = Shared.Resources.Email; loginPassword.Hint = Shared.Resources.Password; forgotPasswordView.Text = Shared.Resources.LoginForgotPassword; googleLoginLabel.Text = Shared.Resources.GoogleLogin; haveAnAccountLabel.Text = Shared.Resources.AlreadyHaveAnAccountQuestionMark; orLabel.Text = Shared.Resources.Or; signUpLabel.Text = Shared.Resources.SignUpTitle; }
private void ExamNameTV_Click(object sender, ExamAdapterClickEventArgs e) { ExamModel examname_clicked = this.ExamList[e.Position]; string examname = examname_clicked.get_exam_name(); Dialog nameDialog = new Dialog(this); nameDialog.SetContentView(Resource.Id.dialog_name_update); EditText editText = (EditText)nameDialog.FindViewById(Resource.Id.dialog_name_editText); editText.Text = examname; /* Non riconosce più android.support.design e quindi ho messo il design che sta in google.design*/ TextInputLayout textInputLayout = (TextInputLayout)nameDialog.FindViewById(Resource.Id.dialog_name_input_layout); Android.Widget.Button okButton = (Android.Widget.Button)nameDialog.FindViewById(Resource.Id.name_ok); okButton.Click += async delegate { string examNameNew = editText.Text.ToUpper(); if (examNameNew.Trim().Equals("")) { textInputLayout.SetErrorTextAppearance(Resource.String.empty_name_field); textInputLayout.RequestFocus(); } else if (examNameNew.Length > 15) { textInputLayout.SetErrorTextAppearance(Resource.String.overflow_name_field); textInputLayout.RequestFocus(); } else if (IsSameName(examNameNew)) { textInputLayout.SetErrorTextAppearance(Resource.String.used_name); textInputLayout.RequestFocus(); } else { /* * Google.Cloud.Firestore.CollectionReference exams = database.Collection("exams"); * Google.Cloud.Firestore.DocumentReference examDoc = exams.Document(examname); * Google.Cloud.Firestore.DocumentSnapshot snapshot = await examDoc.GetSnapshotAsync(); * if (snapshot.Exists) * { * await exams.Document(examNameNew).SetAsync(snapshot); * await examDoc.DeleteAsync(); * } */ } bool IsSameName(string examNewName) { for (int j = 0; j < adapter.ItemCount; j++) { if (ExamList[j].examName.Equals(examNewName)) { return(true); } } return(false); } }; } }
public static IDisposable BindValidationEx <TView, TViewModel, TViewModelProperty>( this TView view, TViewModel?viewModel, Expression <Func <TViewModel, TViewModelProperty?> > viewModelProperty, TextInputLayout viewProperty, IValidationTextFormatter <string>?formatter = null) where TView : IViewFor <TViewModel> where TViewModel : class, IReactiveObject, IValidatableViewModel { if (view is null) { throw new ArgumentNullException(nameof(view)); } if (viewModelProperty is null) { throw new ArgumentNullException(nameof(viewModelProperty)); } if (viewProperty is null) { throw new ArgumentNullException(nameof(viewProperty)); } formatter ??= Locator.Current.GetService <IValidationTextFormatter <string> >() ?? SingleLineFormatter.Default; return(ValidationBinding.ForProperty( view, viewModelProperty, (_, errors) => viewProperty.Error = errors.FirstOrDefault(msg => !string.IsNullOrEmpty(msg)), formatter)); }
public override async void OnViewCreated(View view, Bundle savedInstanceState) { ((IFragmentContainer)Activity).ShowLoadingView(); ((IActionBarContainer)Activity).SetTitle(Resource.String.title_challenge); ((IActionBarContainer)Activity).Hide(); _phoneTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_phone); _methodPhoneTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_methods_phone); _methodEmailTextView = view.FindViewById <MaterialTextView>(Resource.Id.fragment_login_challenge_methods_email); _phoneInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_challenge_phone_input_layout); _phoneEditText = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_challenge_phone_input); _otpInputLayout = view.FindViewById <TextInputLayout>(Resource.Id.fragment_login_challenge_code_input_layout); _otpEditText = view.FindViewById <TextInputEditText>(Resource.Id.fragment_login_challenge_code_input); _submitButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_submit); _resendButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_resend); _methodPhoneButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_phone); _methodEmailButton = view.FindViewById <MaterialButton>(Resource.Id.fragment_login_challenge_button_email); _submitButton.Click += SubmitButton_Click; _resendButton.Click += ResendButton_Click; _methodPhoneButton.Click += PhoneButton_Click; _methodEmailButton.Click += EmailButton_Click; try { _challenge = await _account.StartChallengeAsync(); if (_challenge.SubmitPhoneRequired) { _submitButton.Visibility = ViewStates.Visible; _phoneTextView.Visibility = ViewStates.Visible; return; } if (!string.IsNullOrEmpty(_challenge.StepData.PhoneNumber)) { _methodPhoneTextView.Text = GetString(Resource.String.msg_challenge_methods_phone, _challenge.StepData.PhoneNumber); _methodPhoneTextView.Visibility = ViewStates.Visible; _methodPhoneButton.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(_challenge.StepData.Email)) { _methodEmailTextView.Text = GetString(Resource.String.msg_challenge_methods_email, _challenge.StepData.Email); _methodEmailTextView.Visibility = ViewStates.Visible; _methodEmailButton.Visibility = ViewStates.Visible; } } catch (Exception ex) { ((IErrorHandler)Activity).ShowError(ex); } ((IFragmentContainer)Activity).ShowContentView(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); //TextInputLayout TextInputLayout txtlayoutusername = FindViewById <TextInputLayout>(Resource.Id.textuernameInputLayout); TextInputLayout textpasswordInputLayout = FindViewById <TextInputLayout>(Resource.Id.textpasswordInputLayout); EditText txtusername = FindViewById <EditText>(Resource.Id.txtusername); EditText txtpassword = FindViewById <EditText>(Resource.Id.txtpassword); Button btnclick = FindViewById <Button>(Resource.Id.btnclick); //Spinner spinner = FindViewById <Spinner>(Resource.Id.ddlmechservicetype); var adapter = ArrayAdapter.CreateFromResource( this, Resource.Array.pro_Languages, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; //Button Click btnclick.Click += (sender, e) => { //Showing Notifications Toast.MakeText(this, txtusername.Text, ToastLength.Short).Show(); Toast.MakeText(this, txtpassword.Text, ToastLength.Short).Show(); Toast.MakeText(this, spinner.SelectedItemPosition.ToString(), ToastLength.Short).Show(); }; }
protected override void OnCreate(Bundle savedInstanceState) { rssReaderService = new RssReaderService(Constants.ConnectionString); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_addrsssource); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = "Add RSS Item"; SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); titleTextInputLayout = FindViewById <TextInputLayout>(Resource.Id.addrsssource_titleEdittextInputLayout); urlTextInputLayout = FindViewById <TextInputLayout>(Resource.Id.addrsssource_urlEdittextInputLayout); titleEdittext = FindViewById <EditText>(Resource.Id.addrsssource_titleEdittext); urlEditText = FindViewById <EditText>(Resource.Id.addrsssource_urlEdittext); saveBtn = FindViewById <Button>(Resource.Id.addrsssource_saveBtn); saveBtn.Click += SaveBtn_Click; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.bomba_bomba, container, false); // Inputs TextInputLayout eqAInput = view.FindViewById <TextInputLayout>(Resource.Id.textInBombaEqA); TextInputLayout eqBInput = view.FindViewById <TextInputLayout>(Resource.Id.textInBombaEqB); TextInputLayout eqCInput = view.FindViewById <TextInputLayout>(Resource.Id.textInBombaEqC); MainActivity main = (MainActivity)this.Activity; // Chequa se o objeto fluido da main activity jah foi criado, se sim copia o valor dele para o fluido privado dessa classe if (main.EqBomba != null) { if (main.EqBomba[0] != 0) { eqBomba = main.EqBomba; eqAInput.EditText.Text = main.EqBomba[0].ToString(); eqBInput.EditText.Text = main.EqBomba[1].ToString(); eqCInput.EditText.Text = main.EqBomba[2].ToString(); } } // EventHandler para os inputs eqAInput.EditText.TextChanged += EqATextInputLayout_ChangedText; eqBInput.EditText.TextChanged += EqBTextInputLayout_ChangedText; eqCInput.EditText.TextChanged += EqCTextInputLayout_ChangedText; // Continua com a operação do android var ignored = base.OnCreateView(inflater, container, savedInstanceState); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Gets the layout, and all the relevant views it contains. Layout = inflater.Inflate(Resource.Layout.signupFragLayout3, container, false); Username = Layout.FindViewById<EditText>(Resource.Id.editUsername); UsernameLayout = Layout.FindViewById<TextInputLayout>(Resource.Id.signupUsernameText); Password = Layout.FindViewById<EditText>(Resource.Id.editPassword); Confirm = Layout.FindViewById<EditText>(Resource.Id.editConfirm); // Adds textCheckers to password fields Password.TextChanged += checkCorrectPassword; Confirm.TextChanged += (s, e) => { if (Confirm.Text != "" && Confirm.Text == Password.Text) { ConfirmIsValid = true; Confirm.Background.SetColorFilter(Color.Green, PorterDuff.Mode.SrcAtop); } else { ConfirmIsValid = false; Confirm.Background.SetColorFilter(Color.Red, PorterDuff.Mode.SrcAtop); } }; return Layout; }
protected override void InitializeViews() { loginEmail = FindViewById <TextInputLayout>(Resource.Id.LoginEmail); loginEmailEditText = FindViewById <EditText>(Resource.Id.LoginEmailEditText); resetPasswordButton = FindViewById <Button>(Resource.Id.ResetPasswordButton); loadingProgressBar = FindViewById <ProgressBar>(Resource.Id.LoadingProgressBar); }
private void InitUi() { _btnCancel = FindViewById <Button>(Resource.Id.btn_cancel); _btnRegister = FindViewById <Button>(Resource.Id.btn_add); editTextSystolic = FindViewById <EditText>(Resource.Id.et_sys); editTextDiastolic = FindViewById <EditText>(Resource.Id.et_dia); editTextPulse = FindViewById <EditText>(Resource.Id.et_puls); _editTextSystolicLayout = FindViewById <TextInputLayout>(Resource.Id.et_sys_layout); _editTextDiastolicLayout = FindViewById <TextInputLayout>(Resource.Id.et_dia_layout); _editTextPulseLayout = FindViewById <TextInputLayout>(Resource.Id.et_puls_layout); _btnCancel.Click += (sender, args) => { model = null; Dismiss(); }; _btnRegister.Click += (sender, args) => { if (FormIsValid()) { model.Systolic = string.IsNullOrEmpty(editTextSystolic.Text) ? 0 : float.Parse(editTextSystolic.Text); model.Diastolic = string.IsNullOrEmpty(editTextDiastolic.Text) ? 0 : float.Parse(editTextDiastolic.Text); model.PulseRate = string.IsNullOrEmpty(editTextPulse.Text) ? 0 : float.Parse(editTextPulse.Text); model.RecordDateTime = DateTime.Now; Dismiss(); } }; }
protected override void OnCreate(Bundle savedInstanceState) { _sourceService = new SourceService(Constants.ConnectionString); base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_add); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = "Add RSS Item"; SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); var btnSave = FindViewById <Button>(Resource.Id.add_button_save); _titleTextInputLayout = FindViewById <TextInputLayout>(Resource.Id.add_edittext_title_layout); _urlTextInputLayout = FindViewById <TextInputLayout>(Resource.Id.add_edittext_url_layout); _edittextTitle = FindViewById <EditText>(Resource.Id.add_edittext_title); _edittextUrl = FindViewById <EditText>(Resource.Id.add_edittext_url); // var listviewSource = FindViewById<Button>(Resource.Id.listview_source); btnSave.Click += BtnSaveOnClick; }
protected override void OnCreate(Bundle savedInstanceState) { SupportActionBar.SetDisplayHomeAsUpEnabled(true); base.OnCreate(savedInstanceState); Context context = this; res = context.Resources; SessionManager.SetLocale(res); SetContentView(Resource.Layout.add_secret_lock); SpinnerHint = FindViewById <Spinner>(Resource.Id.spinner_hint); TILPIN = FindViewById <TextInputLayout>(Resource.Id.til_pin); TILCPIN = FindViewById <TextInputLayout>(Resource.Id.til_cpin); TILHintResponse = FindViewById <TextInputLayout>(Resource.Id.til_hint_response); TextPIN = FindViewById <EditText>(Resource.Id.text_pin); TextCPIN = FindViewById <EditText>(Resource.Id.text_cpin); TextHintResponse = FindViewById <EditText>(Resource.Id.text_hint_response); FAB = FindViewById <ImageButton>(Resource.Id.btn_floating_action); Hints = SessionManager.Hints(); var hintsAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, Hints); hintsAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); SpinnerHint.Adapter = hintsAdapter; CheckAgree = FindViewById <CheckBox>(Resource.Id.checkbox_confirm); InitHandlers(); Title = "Add PIN"; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = base.OnCreateView(inflater, container, savedInstanceState); SetupToolbar(view, Resource.String.rename); _issuerLayout = view.FindViewById <TextInputLayout>(Resource.Id.editIssuerLayout); _issuerText = view.FindViewById <TextInputEditText>(Resource.Id.editIssuer); _usernameLayout = view.FindViewById <TextInputLayout>(Resource.Id.editUsernameLayout); _usernameText = view.FindViewById <TextInputEditText>(Resource.Id.editUsername); _issuerText.Append(_issuer); if (_username != null) { _usernameText.Append(_username); } _issuerLayout.CounterMaxLength = Authenticator.IssuerMaxLength; _issuerText.SetFilters(new IInputFilter[] { new InputFilterLengthFilter(Authenticator.IssuerMaxLength) }); _usernameLayout.CounterMaxLength = Authenticator.UsernameMaxLength; _usernameText.SetFilters( new IInputFilter[] { new InputFilterLengthFilter(Authenticator.UsernameMaxLength) }); TextInputUtil.EnableAutoErrorClear(_issuerLayout); var cancelButton = view.FindViewById <MaterialButton>(Resource.Id.buttonCancel); cancelButton.Click += delegate { Dismiss(); }; var renameButton = view.FindViewById <MaterialButton>(Resource.Id.buttonRename); renameButton.Click += delegate { var issuer = _issuerText.Text.Trim(); if (issuer == "") { _issuerLayout.Error = GetString(Resource.String.noIssuer); return; } var args = new RenameEventArgs(_position, issuer, _usernameText.Text); RenameClicked?.Invoke(this, args); Dismiss(); }; _usernameText.EditorAction += (_, args) => { if (args.ActionId == ImeAction.Done) { renameButton.PerformClick(); } }; return(view); }
private void DemoTextInputLayout() { mTextInputLayout = (TextInputLayout)mParentView.FindViewById(Resource.Id.text_input_layout).JavaCast<TextInputLayout>(); mEditText = mTextInputLayout.EditText; mTextInputLayout.SetHint("请输入4位学号"); mEditText.AddTextChangedListener(this); }
/// <summary> /// initialize the controls or widgets, bind them with the view /// </summary> private void InflateLayout() { var inflater = LayoutInflater.FromContext(this.Context); inflater.Inflate(Resource.Layout.custom_edittext, this); this.textLayoutCustom = this.FindViewById <TextInputLayout>(Resource.Id.textLayoutCustom); }
private void findAllView() { buttonLogin = FindViewById <Button>(Resource.Id.loginButton); editTextUsername = FindViewById <EditText>(Resource.Id.userNameEditText); editTextPassword = FindViewById <EditText>(Resource.Id.passwordEditText); textInputLayoutPassword = FindViewById <TextInputLayout>(Resource.Id.userNameTextInputLayout); textInputLayoutUsername = FindViewById <TextInputLayout>(Resource.Id.passwordTextInputLayout); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Gets the layout, and all the relevant views it contains. var layout = inflater.Inflate(Resource.Layout.signupFragLayout1, null); NameLayout = layout.FindViewById<TextInputLayout>(Resource.Id.signupName); AddressLayout = layout.FindViewById<TextInputLayout>(Resource.Id.signupAddress); Name = layout.FindViewById<EditText>(Resource.Id.editSignUpName); Address = layout.FindViewById<EditText>(Resource.Id.editAddress); return layout; }
private void FindViews (View v) { EmailEditText = v.FindViewById<EditText> (Resource.Id.CreateUserEmailEditText).SetFont (Font.Roboto); PasswordInputLayout = v.FindViewById<TextInputLayout> (Resource.Id.CreateUserPasswordLayout); PasswordEditText = v.FindViewById<EditText> (Resource.Id.CreateUserPasswordEditText).SetFont (Font.Roboto); RegisterButton = v.FindViewById<Button> (Resource.Id.CreateUserButton).SetFont (Font.Roboto); LoginButton = v.FindViewById<Button> (Resource.Id.LoginButton); SpinningImage = v.FindViewById<ImageView> (Resource.Id.RegisterLoadingImageView); RegisterFormLayout = v.FindViewById<LinearLayout> (Resource.Id.RegisterForm); RegisterSuccessLayout = v.FindViewById<LinearLayout> (Resource.Id.RegisterSuccessScreen); PasswordToggleButton = v.FindViewById<Button> (Resource.Id.RegisterPasswordToggleButton).SetFont (Font.Roboto); SuccessTimerButton = v.FindViewById<Button> (Resource.Id.GoToTimerButton); LegalTextView = v.FindViewById<TextView> (Resource.Id.RegisterLegalTextView); GoogleRegisterButton = v.FindViewById<Button> (Resource.Id.GoogleRegisterButton); var spinningImageAnimation = AnimationUtils.LoadAnimation (Activity.BaseContext, Resource.Animation.SpinningAnimation); SpinningImage.StartAnimation (spinningImageAnimation); SpinningImage.ImageAlpha = 0; }
private void ListView_Click(int position) { if (adapter.Count == 0) { Refresh(); if (adapter.Count == 0) Show("항목이 없습니다"); return; } var jobFile = adapter.GetItem(position); if (jobFile.JobCount.Total == 0) { Show("CN 항목이 없습니다"); return; } InputMethodManager imm = (InputMethodManager)Context.GetSystemService(Context.InputMethodService); View dialogView = LayoutInflater.From(Context).Inflate(Resource.Layout.weld_count_editor, null); AlertDialog.Builder dialog = new AlertDialog.Builder(Context); dialog.SetView(dialogView); var statusText = dialogView.FindViewById<TextView>(Resource.Id.statusText); statusText.Text = "계열 수정 (CN: " + jobFile.JobCount.Total.ToString() + "개)"; var linearLayout = dialogView.FindViewById<LinearLayout>(Resource.Id.linearLayout); var etBeginNumber = dialogView.FindViewById<EditText>(Resource.Id.etBeginNumber); var sbBeginNumber = dialogView.FindViewById<SeekBar>(Resource.Id.sampleSeekBar); var etList = new List<EditText>(); for (int i = 0; i < jobFile.Count; i++) { if (jobFile[i].RowType == Job.RowTypes.Spot) { var textInputLayout = new TextInputLayout(Context); var etCN = new EditText(Context); etCN.SetSingleLine(); etCN.SetTextSize(ComplexUnitType.Dip, 12); etCN.InputType = etBeginNumber.InputType; etCN.SetSelectAllOnFocus(true); etCN.Hint = "CN[" + jobFile[i].RowNumber + "]"; etCN.Text = jobFile[i].CN; etCN.Gravity = GravityFlags.Center; etCN.Tag = jobFile[i]; etCN.FocusChange += (object sender1, View.FocusChangeEventArgs e1) => { int beginNumber; if (Int32.TryParse(etCN.Text, out beginNumber)) { if (beginNumber > 255) { beginNumber = 255; etCN.Text = beginNumber.ToString(); } } }; etCN.KeyPress += (object sender1, View.KeyEventArgs e1) => { e1.Handled = false; if (e1.KeyCode == Keycode.Enter || e1.KeyCode == Keycode.Back || e1.KeyCode == Keycode.Escape) { imm.HideSoftInputFromWindow(etCN.WindowToken, 0); etCN.ClearFocus(); e1.Handled = true; } }; textInputLayout.AddView(etCN); linearLayout.AddView(textInputLayout); etList.Add(etCN); } } etBeginNumber.FocusChange += (object sender1, View.FocusChangeEventArgs e1) => { int beginNumber; if (int.TryParse(etBeginNumber.Text, out beginNumber)) { if (beginNumber > 255) { beginNumber = 255; etBeginNumber.Text = beginNumber.ToString(); } sbBeginNumber.Progress = beginNumber - 1; foreach (var et in etList) { et.Text = beginNumber++.ToString(); if (beginNumber > 255) beginNumber = 255; } } }; etBeginNumber.KeyPress += (object sender1, View.KeyEventArgs e1) => { e1.Handled = false; if (e1.KeyCode == Keycode.Enter || e1.KeyCode == Keycode.Back || e1.KeyCode == Keycode.Escape) { imm.HideSoftInputFromWindow(etBeginNumber.WindowToken, 0); etBeginNumber.ClearFocus(); e1.Handled = true; } }; sbBeginNumber.Max = 254; sbBeginNumber.Progress = 0; sbBeginNumber.ProgressChanged += (object sender1, SeekBar.ProgressChangedEventArgs e1) => { int beginNumber = sbBeginNumber.Progress + 1; etBeginNumber.Text = beginNumber.ToString(); }; sbBeginNumber.StopTrackingTouch += (object sender1, SeekBar.StopTrackingTouchEventArgs e1) => { int beginNumber = sbBeginNumber.Progress + 1; etBeginNumber.Text = beginNumber.ToString(); foreach (var et in etList) { et.Text = beginNumber++.ToString(); if (beginNumber > 255) beginNumber = 255; } }; dialog.SetNegativeButton("취소", delegate { }); dialog.SetPositiveButton("저장", delegate { foreach (var et in etList) { var job = (Job)et.Tag; job.CN = et.Text; } if (jobFile.JobCount.Total > 0) { jobFile.SaveFile(); adapter.NotifyDataSetChanged(); listView.RefreshDrawableState(); this.Show((string)("저장 완료: " + jobFile.JobCount.fi.Name)); } }); dialog.Show(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Gets the layout, and all the relevant views it contains. var layout = inflater.Inflate(Resource.Layout.editEventInfoLayout, null); NameLayout = layout.FindViewById<TextInputLayout>(Resource.Id.edit_title_layout); DescriptionLayout = layout.FindViewById<TextInputLayout>(Resource.Id.edit_description_layout); LocationLayout = layout.FindViewById<TextInputLayout>(Resource.Id.edit_location_layout); MaxSlotsLayout = layout.FindViewById<TextInputLayout>(Resource.Id.edit_guests_layout); Name = layout.FindViewById<EditText>(Resource.Id.edit_title); Description = layout.FindViewById<EditText>(Resource.Id.edit_description); Location = layout.FindViewById<EditText>(Resource.Id.edit_location); MaxSlots = layout.FindViewById<EditText>(Resource.Id.edit_guests); // Sets all the textfields information to be the infomation stored in the Activities Intent. Name.Text = Activity.Intent.GetStringExtra("title"); Description.Text = Activity.Intent.GetStringExtra("description"); Location.Text = Activity.Intent.GetStringExtra("place"); MaxSlots.Text = Activity.Intent.GetIntExtra("maxslots", 0).ToString(); return layout; }
/// <summary> /// A helpermethod for updating the TextInputLayouts error messages and color. /// </summary> /// <param name="layout">The layout to update.</param> /// <param name="text">The textfield the layout contains.</param> /// <param name="message">The error message.</param> /// <param name="noerror">The validation bool. true means, the information is valid, false means not.</param> private void UpdateLayout(TextInputLayout layout, EditText text, int message, bool noerror) { layout.ErrorEnabled = !noerror; if (noerror) { // There should be no message, when no error occured, and the color should be green. layout.Error = string.Empty; text.Background.SetColorFilter(Color.Green, PorterDuff.Mode.SrcAtop); } else { // There should be a message, when an error occured, and the color should be red. layout.Error = Resources.GetString(message); text.Background.SetColorFilter(Color.Red, PorterDuff.Mode.SrcAtop); } }