void Control_FocusChange(object sender, Android.Views.View.FocusChangeEventArgs e) { if (e.HasFocus && BaseElement.SuppressKeyboard) { UIHelper.CloseSoftKeyboard(Control); } }
//void Control_Touch(object sender, Android.Views.View.TouchEventArgs e) //{ // Control.Focusable = true; // Control.RequestFocus(); // Control.RequestFocusFromTouch(); // Control.SetSelection(Control.Text.Length); // InputMethodManager inputMethodManager = this.Context.GetSystemService(Context.InputMethodService) as InputMethodManager; // inputMethodManager.ShowSoftInput(Control, ShowFlags.Forced); // inputMethodManager.ToggleSoftInput(ShowFlags.Forced, HideSoftInputFlags.ImplicitOnly); //} //override appl void HideSoftKeyBoardOnTextChanged(MvvmAspire.Controls.Entry element) { if (element.IsFocused && BaseElement.SuppressKeyboard) { UIHelper.CloseSoftKeyboard(Control); } }
public bool OnEditorAction(TextView v, ImeAction actionId, KeyEvent e) { if (BaseElement.NextElement == null && (actionId == ImeAction.Done || actionId == ImeAction.Next)) { UIHelper.CloseSoftKeyboard(Control); if (BaseElement.Command != null && BaseElement.Command.CanExecute(null)) { System.Windows.Input.ICommand cmd = BaseElement.Command; cmd.Execute(null); } return(false); } if (actionId == ImeAction.Done || actionId == ImeAction.Next) { BaseElement.NextElement.Focus(); UIHelper.OpenSoftKeyboard(Control); return(true); } return(false); }
protected override void OnFocusChanged(bool gainFocus, FocusSearchDirection direction, Android.Graphics.Rect previouslyFocusedRect) { base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect); if (gainFocus && BaseElement.SuppressKeyboard) { UIHelper.CloseSoftKeyboard(Control); } }
void HideSoftKeyBoardOnTextChanged(MvvmAspire.Controls.Editor element) { if (element.IsFocused && BaseElement.SuppressKeyboard) { UIHelper.CloseSoftKeyboard(Control); } //if (string.IsNullOrWhiteSpace(Element.Text)) // Control.Text = ""; //else // Control.Text = element.Text; }
public override bool OnTouchEvent(MotionEvent e) { //if (SuppressKeyboard) // isTextEditor = false; var returnValue = base.OnTouchEvent(e); if (SuppressKeyboard) { //isTextEditor = true; UIHelper.CloseSoftKeyboard(this); } return(returnValue); }
async void Control_ViewAttachedToWindow(object sender, ViewAttachedToWindowEventArgs e) { if (BaseElement.SuppressKeyboard) { var activity = ((Activity)Context); var viewGroup = (ViewGroup)activity.Window.DecorView; UnfocusPlatformRenderer(viewGroup); await Task.Delay(100); UIHelper.CloseSoftKeyboard(Control); } }
protected async override void OnAttachedToWindow() { base.OnAttachedToWindow(); if (SuppressKeyboard) { var activity = ((Activity)Context); var viewGroup = (ViewGroup)activity.Window.DecorView; UnfocusPlatformRenderer(viewGroup); await Task.Delay(100); UIHelper.CloseSoftKeyboard(this); } }
public bool OnEditorAction(TextView v, ImeAction actionId, KeyEvent e) { if (Element.NextElement == null && (actionId == ImeAction.Done || actionId == ImeAction.Next)) { UIHelper.CloseSoftKeyboard(Control); if (Element.Command != null && Element.Command.CanExecute(Element.CommandParameter)) { Element.Command.Execute(Element.CommandParameter); } return(false); } if (actionId == ImeAction.Done || actionId == ImeAction.Next) { Element.NextElement.Focus(); UIHelper.OpenSoftKeyboard(Control); return(true); } return(false); }