Esempio n. 1
0
        bool TextView.IOnEditorActionListener.OnEditorAction(TextView v, ImeAction actionId, KeyEvent e)
        {
            // Fire Completed and dismiss keyboard for hardware / physical keyboards
            if (actionId == ImeAction.Done || actionId == _currentInputImeFlag || (actionId == ImeAction.ImeNull && e.KeyCode == Keycode.Enter && e.Action == KeyEventActions.Up))
            {
                global::Android.Views.View nextFocus = null;
                if (_currentInputImeFlag == ImeAction.Next)
                {
                    nextFocus = FocusSearch(v, FocusSearchDirection.Forward);
                }

                if (nextFocus != null)
                {
                    nextFocus.RequestFocus();
                    if (!nextFocus.OnCheckIsTextEditor())
                    {
                        v.HideKeyboard();
                    }
                }
                else
                {
                    EditText.ClearFocus();
                    v.HideKeyboard();
                }

                ((IEntryController)Element).SendCompleted();
            }

            return(true);
        }