/// <summary> /// Проверка и сохранение правой границы (после закрытия клавиатуры) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleRightAction(object sender, TextView.EditorActionEventArgs e) { e.Handled = false; if (e.ActionId == ImeAction.Done) { EditText right_ = sender as EditText; e.Handled = true; NewFocus(right_); if (!int.TryParse(right_.Text, out int x) || x < 0 || x >= arrayT.Length) { ShowMessage("Error in right border!"); if (right != null) { right_.Text = right.ToString(); } else { right_.Text = ""; } return; } right = x; } }
protected void _entry_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Go) { Send(); } }
private void Control_EditorAction(object sender, TextView.EditorActionEventArgs args) { //Control.EditorAction -= Control_EditorAction; CustomReturnEntry customEntry = (CustomReturnEntry)Element; if (args?.Event?.KeyCode == Keycode.Enter) { return; } var dtNow = DateTime.Now; bool shouldTriggerEvent = false; if (_lastEnterKeyPressed == null) { shouldTriggerEvent = true; } else { TimeSpan ts = dtNow - _lastEnterKeyPressed.Value; if (ts.TotalMilliseconds > 100) { shouldTriggerEvent = true; } } _lastEnterKeyPressed = dtNow; if (shouldTriggerEvent) { customEntry.ReturnCommand?.Execute(null); customEntry.OnRetrunKeyPress(); } }
private void OnTextFieldEditorActionListener(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { TextField.ClearFocus(); } }
private async void TxtPartNumber_EditorAction(object sender, TextView.EditorActionEventArgs e) { DataRecord result; e.Handled = false; if (e.ActionId == ImeAction.Send) { DismissKeyboard(); try { result = await DataBaseAccess.GetData(txtPartNumber.Text, hF.spnDB.SelectedItem.ToString()); } catch (Exception ex) { Toast.MakeText(Activity, ex.Message, ToastLength.Long).Show(); sF.txtStatus.Text = ex.Message; txtPartNumber.Text = ""; e.Handled = true; return; } //result = await DataBaseAccess.GetData(txtPartNumber.Text, hF.spnDB.SelectedItem.ToString()); UpdateValues(result); sF.txtStatus.Text = "Partnumber found!"; //Toast.MakeText(Activity, "Value Entered: " + txtPartNumber.Text, ToastLength.Short).Show(); e.Handled = true; } }
private void AndroidEditTextOnEditorAction(object sender, TextView.EditorActionEventArgs editorActionEventArgs) { if (editorActionEventArgs.ActionId == ImeAction.Done) { IsSelectionActive = false; } }
/// <summary> /// Проверка и сохранение содержимого в ячейке порождающего множества моноида (после закрытия клавиатуры) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleSetAction(object sender, TextView.EditorActionEventArgs e) { e.Handled = false; if (e.ActionId == ImeAction.Done) { EditText set = sender as EditText; e.Handled = true; NewFocus(set); string[] splitted = set.Text.Split(", "); // если один из элементов порождающего множества не удовлетворяет условию if (!Array.TrueForAll(splitted, s => int.TryParse(s, out int x) && x >= 0)) { ShowMessage("Error in generating set!"); set.Text = string.Join(", ", generating_set); return; } generating_set = new int[splitted.Length]; for (int i = 0; i < splitted.Length; ++i) { generating_set[i] = int.Parse(splitted[i]); } monoid.Clear(); } }
/// <summary> /// Проверка и сохранение константы, на которую следует обновить элемент (после закрытия клавиатуры) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void HandleXAction(object sender, TextView.EditorActionEventArgs e) { e.Handled = false; if (e.ActionId == ImeAction.Done) { EditText x_ = sender as EditText; e.Handled = true; NewFocus(x_); if (!int.TryParse(x_.Text, out int x) || x < 0 || x >= p) { ShowMessage("Error in x!"); if (xx != null) { x_.Text = xx.ToString(); } else { x_.Text = ""; } return; } xx = x; } }
private async void CPassword_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == Android.Views.InputMethods.ImeAction.Done) { await DoThings(); } }
void Etiqueta_KeyPress(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { TipoEtiquetas etiqueta_tipo; if (((EditText)sender).Id == Resource.Id.txtHabilidades) { etiqueta_tipo = TipoEtiquetas.Habilidad; } else { etiqueta_tipo = TipoEtiquetas.Interes; } string etiqueta_id; try { etiqueta_id = etiquetas.Find(etiqueta => etiqueta.Etiqueta_Nombre.Equals(((EditText)sender).Text)).Etiqueta_Id; } catch { etiqueta_id = null; } new UsuariosController().AddRemoveEtiquetas(miembro.Usuario_Id, miembro.Usuario_Tipo, !string.IsNullOrEmpty(etiqueta_id) ? etiqueta_id : null, ((EditText)sender).Text, etiqueta_tipo, null); if (etiqueta_tipo == TipoEtiquetas.Habilidad) { FillEtiqueta(etiqueta_tipo.ToString(), profileView.FindViewById <RelativeLayout>(Resource.Id.rlHabilidades)); } else { FillEtiqueta(etiqueta_tipo.ToString(), profileView.FindViewById <RelativeLayout>(Resource.Id.rlIntereses)); } } }
private void CUser_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == Android.Views.InputMethods.ImeAction.Next) { cPassword.RequestFocus(); } }
private void Edit_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { SendCode(); } }
private void OnDescriptionEditorAction (object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == Android.Views.InputMethods.ImeAction.Done) { CommitDescriptionChanges (); } e.Handled = false; }
void AddNewItem(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId != ImeAction.Done) { return; } ItemClass newItem = new ItemClass() { Name = newItemEditText.Text, Purchased = false.ToString(), Time = DateTime.UtcNow.ToString() }; curList.Items.Add(newItem); //save item locally ReadWrite.WriteData(); //save item online SaveItemOnCloud.Save(newItem, curList); itemsAdapter.NotifyDataSetChanged(); newItemEditText.Text = ""; newItemEditText.Hint = "+ New Item"; //FindFocus basically gets the previous focus and uses that after inputing a new item and removing the keyboard this.CurrentFocus.FindFocus(); InputMethodManager inputManager = (InputMethodManager)GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.None); }
void AddNewItem(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId != ImeAction.Done) { return; } ItemClass newItem = new ItemClass() { Name = newItemEditText.Text, Purchased = false.ToString(), Time = DateTime.UtcNow.ToString() }; curList.Items.Add(newItem); ReadWrite.WriteData(); newItemEditText.Text = ""; itemsAdapter.NotifyDataSetChanged(); // iOS -> resignFirstReponsde this.CurrentFocus.ClearFocus(); InputMethodManager inputManager = (InputMethodManager)GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.None); }
private void OnSetDaysEditTextEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { ClearFocusFromAllEditTexts((sender as EditText)); } }
private void EntryOnEditorAction(object sender, TextView.EditorActionEventArgs e) { if (Owner != null) { Owner.OnEditorAction(e); } }
private void OnEndTimeHoursEditTextEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Next) { ClearFocusFromAllEditTexts((sender as EditText)); } }
private async void OnBrightnessEditTextEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { var editText = sender as EditText; var validationResult = ValidateTimerBrightness(editText); if (validationResult == true) { _brightnessEditText.SetTextColor(Color.Black); _sliderValue = int.Parse(editText.Text); _valueToSend = _sliderValue; _onOffSwitch.Checked = _sliderValue != 0; _sliderSeekBar.Progress = _sliderValue; PrepareDataService.PrepareData(0x01, (byte)_sliderValue, 0x00); await SendDataService.SendData(_socket); } else { _brightnessEditText.SetError("Invalid brightness value\nMust be between 0 and 100", null); _brightnessEditText.SetTextColor(Color.Red); } } e.Handled = false; ClearFocusFromAllEditTexts(sender as EditText); }
void OnEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == Android.Views.InputMethods.ImeAction.Done) { OnEditingEnded(true); } }
private void Et_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Done) { CreateNewCommandInstance(input.Text.Split(' ')); } }
private void OnDescriptionTextEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == Android.Views.InputMethods.ImeAction.Send) { AddOrEditExpenseItem(); } }
private void TxtSearch_EditorAction(object sender, TextView.EditorActionEventArgs e) { UpdateFoodSuggestionsStorage(); //@ToDo: replace this minimalistic extension with an actual search/suggestions engine. ApplySearchFilter(NearbyStores); HideKeyboar(this); ActiveSearch = true; }
void _entry_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == ImeAction.Go) { Send(); //return true; } }
private void QueryEditText_EditorAction(object sender, TextView.EditorActionEventArgs e) { if (e.ActionId == global::Android.Views.InputMethods.ImeAction.Search) { Vm.SearchCommand.Execute("default"); RefreshUI(); } }
public virtual void OnEditorAction(TextView.EditorActionEventArgs e) { //Log.Info("Just playing", "Action:" + e.ActionId); if (e.ActionId == ImeAction.Go) { Send(); } }
private void AnswerEdit_EditorAction(object sender, TextView.EditorActionEventArgs e) { e.Handled = false; if (e.ActionId == Android.Views.InputMethods.ImeAction.Done) { answerBtn.PerformClick(); } }
private void TextField_OnDone(object sender, TextView.EditorActionEventArgs e) { var textView = (TextView)sender; var imm = (InputMethodManager)GetSystemService(InputMethodService); textView.ClearFocus(); imm.HideSoftInputFromWindow(textView.WindowToken, 0); }
private void TxtUser_EditorAction(object sender, TextView.EditorActionEventArgs e) { e.Handled = false; if (e.ActionId == Android.Views.InputMethods.ImeAction.Next) { txtPwd.RequestFocus(); e.Handled = true; } }
void HandleEditorAction(object sender, TextView.EditorActionEventArgs e) { if (e?.Event?.KeyCode == Keycode.Enter) { return; } CustomReturnEffect.GetReturnCommand(Element)?.Execute(CustomReturnEffect.GetReturnCommandParameter(Element)); }