Exemplo n.º 1
0
        /// <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;
            }
        }
Exemplo n.º 2
0
 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();
            }
        }
Exemplo n.º 4
0
 private void OnTextFieldEditorActionListener(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Done)
     {
         TextField.ClearFocus();
     }
 }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
 private void AndroidEditTextOnEditorAction(object sender, TextView.EditorActionEventArgs editorActionEventArgs)
 {
     if (editorActionEventArgs.ActionId == ImeAction.Done)
     {
         IsSelectionActive = false;
     }
 }
Exemplo n.º 7
0
        /// <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();
            }
        }
Exemplo n.º 8
0
        /// <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;
            }
        }
Exemplo n.º 9
0
 private async void CPassword_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == Android.Views.InputMethods.ImeAction.Done)
     {
         await DoThings();
     }
 }
Exemplo n.º 10
0
 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));
         }
     }
 }
Exemplo n.º 11
0
 private void CUser_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == Android.Views.InputMethods.ImeAction.Next)
     {
         cPassword.RequestFocus();
     }
 }
Exemplo n.º 12
0
 private void Edit_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Done)
     {
         SendCode();
     }
 }
Exemplo n.º 13
0
 private void OnDescriptionEditorAction (object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == Android.Views.InputMethods.ImeAction.Done) {
         CommitDescriptionChanges ();
     }
     e.Handled = false;
 }
Exemplo n.º 14
0
        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);
        }
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
 private void OnSetDaysEditTextEditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Done)
     {
         ClearFocusFromAllEditTexts((sender as EditText));
     }
 }
Exemplo n.º 17
0
 private void EntryOnEditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (Owner != null)
     {
         Owner.OnEditorAction(e);
     }
 }
Exemplo n.º 18
0
 private void OnEndTimeHoursEditTextEditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Next)
     {
         ClearFocusFromAllEditTexts((sender as EditText));
     }
 }
Exemplo n.º 19
0
        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);
     }
 }
Exemplo n.º 21
0
 private void Et_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Done)
     {
         CreateNewCommandInstance(input.Text.Split(' '));
     }
 }
Exemplo n.º 22
0
 private void OnDescriptionTextEditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == Android.Views.InputMethods.ImeAction.Send)
     {
         AddOrEditExpenseItem();
     }
 }
Exemplo n.º 23
0
 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;
 }
Exemplo n.º 24
0
 void _entry_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == ImeAction.Go)
     {
         Send();
         //return true;
     }
 }
Exemplo n.º 25
0
 private void QueryEditText_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     if (e.ActionId == global::Android.Views.InputMethods.ImeAction.Search)
     {
         Vm.SearchCommand.Execute("default");
         RefreshUI();
     }
 }
Exemplo n.º 26
0
 public virtual void OnEditorAction(TextView.EditorActionEventArgs e)
 {
     //Log.Info("Just playing", "Action:" + e.ActionId);
     if (e.ActionId == ImeAction.Go)
     {
         Send();
     }
 }
Exemplo n.º 27
0
 private void AnswerEdit_EditorAction(object sender, TextView.EditorActionEventArgs e)
 {
     e.Handled = false;
     if (e.ActionId == Android.Views.InputMethods.ImeAction.Done)
     {
         answerBtn.PerformClick();
     }
 }
Exemplo n.º 28
0
        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);
        }
Exemplo n.º 29
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));
        }