Example #1
0
        void EditText1_KeyPress(object sender, Android.Views.View.KeyEventArgs e)
        {
            if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
            {
                e.Handled = true;
                DismissKeyboard();
                var editText    = (EditText)sender;
                var currentItem = editText.Text;
                if (currentItem != "")
                {
                    mItems.Add(currentItem);
                    adapter.NotifyDataSetChanged();
                    editText.Text = "";
                    string jsonoutput = Newtonsoft.Json.JsonConvert.SerializeObject(mItems, Newtonsoft.Json.Formatting.Indented);
                    File.WriteAllText(fullPath, jsonoutput);
                }


                if (currentItem == "")
                {
                }
            }
            else
            {
                e.Handled = false;
            }
        }
Example #2
0
        private void EditEstBills_KeyPress(object sender, Android.Views.View.KeyEventArgs e)
        {
            e.Handled = false;
            if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter)
            {
                float floatValue;

                bool isFloat = float.TryParse
                                   (editEstBills.Text.ToString().Replace('.', ','), out floatValue);

                if (isFloat)
                {
                    estBills = floatValue;

                    Application.Context.GetSharedPreferences("MyNumbers", FileCreationMode.Private).
                    Edit().PutFloat("EstBills", estBills).Commit();

                    InputMethodManager inputManager = (InputMethodManager)Application.GetSystemService(Context.InputMethodService);
                    inputManager.HideSoftInputFromWindow(editEstBills.WindowToken, HideSoftInputFlags.None);
                    e.Handled = true;
                    CountBalance();
                }
                else
                {
                    Toast.MakeText(this, string.Format("Nieprawidłowa kwota"), ToastLength.Short).Show();
                }
            }
        }
        public static KeyEventArgs ToXwt(this AV.View.KeyEventArgs args)
        {
            return(new KeyEventArgs(
                       args.Event.KeyCode.ToXwt(),
                       args.Event.MetaState.ToXwt(),
                       false,
                       args.Event.EventTime

                       ));
        }
        void cString_KeyPress(object sender, Android.Views.View.KeyEventArgs e)
        {
            e.Handled = false;

            if (ToolControl.isDone(e.KeyCode, e.Event.Number))
            {
                e.Handled = true;
                returnData(getData());
            }
        }
 private void OnControlKeyPress(object sender, Android.Views.View.KeyEventArgs e)
 {
     if (e.Event.Action == KeyEventActions.Down)
     {
         e.Handled = HardwareKeyListener.OnKeyDown(e.KeyCode, e.Event);
     }
     else
     {
         e.Handled = false;
     }
     //System.Diagnostics.Debug.WriteLine("HardwareKeyListenerEffect.OnControlKeyPress [" + e.Event + "][" + e.Handled + "][" + e.KeyCode + "]");
 }
Example #6
0
 private static void OnKeyPress(object sender, Android.Views.View.KeyEventArgs e)
 {
     if (ValuePickerRenderer.availableKeys.Contains(e.KeyCode))
     {
         e.Handled = false;
     }
     else
     {
         e.Handled = true;
         if (!(sender is Android.Views.View view2))
         {
             return;
         }
         view2.CallOnClick();
     }
 }
Example #7
0
        private void GameView_KeyPress(object sender, Android.Views.View.KeyEventArgs e)
        {
            if (e.Event.Action == Android.Views.KeyEventActions.Down)
            {
                uint ch = 0;
                if (e.Event.KeyCode == Android.Views.Keycode.Del)
                {
                    ch = '\b';
                    this.View.KeyDown(Key.Back);
                }
                else if (e.Event.KeyCode == Android.Views.Keycode.Enter)
                {
                    ch = '\n';
                    this.View.KeyDown(Key.Enter);
                }
                else
                {
                    ch = (uint)e.Event.GetUnicodeChar(e.Event.MetaState);
                }

                this.View.Char(ch);
            }
        }