void EditText_FocusChange(object sender, FocusChangeEventArgs e) { var mgr = (InputMethodManager)Context.GetSystemService(Context.InputMethodService); if (TextViewError.Visibility == ViewStates.Invisible) { if (e.HasFocus) { DividerLine.SetBackgroundColor(new Color(DividerColorFocus.ToArgb())); } else { DividerLine.SetBackgroundColor(new Color(DividerColor.ToArgb())); } } if (e.HasFocus) { mgr.ShowSoftInput(EditTextControl, ShowFlags.Implicit); UpdateLabelSize(e.HasFocus); } else { Validate(); } }
private void ViewImpl_FocusChange(object sender, FocusChangeEventArgs e) { if (!e.HasFocus) { LostFocus?.Invoke(); } }
void OnFocusedChange(object?sender, FocusChangeEventArgs e) { if (!e.HasFocus) { VirtualView?.Completed(); } }
private void InstantAutoCompleteTextView_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ShowDropDown(); } }
void OnPickerFocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ShowDatePicker(); } }
private void Control_FocusChange(object sender, FocusChangeEventArgs e) { if (!e.HasFocus) { Control.SetSelection(0); } }
// This will eliminate additional native property setting if not required. void OnFocusedChange(object?sender, FocusChangeEventArgs e) { if (VirtualView?.ClearButtonVisibility == ClearButtonVisibility.WhileEditing) { UpdateValue(nameof(IEntry.ClearButtonVisibility)); } }
void EditText_FocusChange(object sender, FocusChangeEventArgs e) { var mgr = (InputMethodManager)Context.GetSystemService(Context.InputMethodService); if (string.IsNullOrEmpty(ErrorText)) { if (e.HasFocus) { DividerLine.SetBackgroundColor(new Color(ContextCompat.GetColor(Context, Resource.Color.deep_lemon))); } else { DividerLine.SetBackgroundColor(new Color(ContextCompat.GetColor(Context, Resource.Color.deep_lemon))); } } else { DividerLine.SetBackgroundColor(new Color(ContextCompat.GetColor(Context, Resource.Color.deep_lemon))); } if (e.HasFocus) { mgr.ShowSoftInput(EditTextControl, ShowFlags.Implicit); UpdateLabelSize(e.HasFocus); } }
private void Control_FocusChange(object sender, FocusChangeEventArgs e) { // Workaround to avoid null reference exceptions in runtime if (this.EditText.Text == null) { this.EditText.Text = string.Empty; } if (e.HasFocus) { this.mKeyboardView.OnKeyboardActionListener = this; if (this.Element.Keyboard == Keyboard.Text) { this.CreateCustomKeyboard(); } this.ShowKeyboardWithAnimation(); } else { // When the control looses focus, we set an empty listener to avoid crashes this.mKeyboardView.OnKeyboardActionListener = new NullListener(); this.HideKeyboardView(); } }
void _textInputEditText_FocusChange(object sender, FocusChangeEventArgs e) { // TODO figure out better way to do this // this is a hack that changes the active underline color from the accent color to whatever the user // specified Device.BeginInvokeOnMainThread(() => UpdatePlaceholderColor(false)); }
private void HighlightOffIfLostFocus(object sender, FocusChangeEventArgs e) { if (!e.Focused) { HighlightOff(sender, null); } }
private void Picker_FocusChanged(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ShowDatePicker(); } }
private void EditTextOccurrences_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ViewModel.SelectedEndOption = RecurrenceControlViewModel.EndOptions.Occurrences; } }
void Control_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ShowTimePicker(); } }
private void AutoCompleteTextView_FocusChange(object sender, FocusChangeEventArgs e) { if (sender is AutoCompleteTextView && e.HasFocus && !_didShownDropDown && Control.Text.Length == 0) { _didShownDropDown = true; Control.ShowDropDown(); } }
void EditText_FocusChange(object sender, FocusChangeEventArgs e) { _ultimateEntry.EntryIsFocused = e.HasFocus; UpdateControlUI(); AddKeyboardPlaceholder(_ultimateEntry.UseKeyboardPlaceholder && e.HasFocus); _ultimateEntry.EntryFocusChangedDelegate(sender, new FocusEventArgs(_ultimateEntry, e.HasFocus)); }
private void _viajarA_FocusChange(object sender, FocusChangeEventArgs e) { if (_viajarA.IsFocused) { FragmentTransaction _transaction = FragmentManager.BeginTransaction(); FiltrarAeropuertoDialog _FiltrarAeropuertoDialog = new FiltrarAeropuertoDialog(delegate(string aeropuerto) { _viajarA.Text = aeropuerto; }, Resource.Style.dialog_animation_ViajarA, _viajarA.Hint); _FiltrarAeropuertoDialog.Show(_transaction, "Filtrar Aeropuerto"); } }
/* * This currently does two things * 1) It's a hacky way of keeping the underline color matching the TextColor. * when the entry gets focused the underline gets changed to the themes active color * and this is the only way to set it away from that and to whatever the user specified * 2) The HintTextColor has a different alpha when focused vs not focused * */ void OnFocusChange(object sender, FocusChangeEventArgs e) { Device.BeginInvokeOnMainThread(() => ApplyTheme()); // propagate the focus changed event to the View Renderer base class if (Parent is AView.IOnFocusChangeListener focusChangeListener) { focusChangeListener.OnFocusChange(EditText, e.HasFocus); } }
void OnControlFocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { (Forms.Context as Activity).Window.SetSoftInputMode(SoftInput.AdjustResize); } else { (Forms.Context as Activity).Window.SetSoftInputMode(SoftInput.AdjustNothing); } }
private void TxtUserName_FocusChange(object sender, FocusChangeEventArgs e) { if (!txtUserName.HasFocus) { if (!txtPassword.HasFocus) { inputManager = (InputMethodManager)this.GetSystemService(Activity.InputMethodService); inputManager.HideSoftInputFromWindow(txtUserName.WindowToken, HideSoftInputFlags.None); } } }
void Control_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { ShowTimePicker(); ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true); } else { ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false); } }
private void Control_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { Control.EditorAction -= Control_EditorAction; Control.EditorAction += Control_EditorAction; } else { Control.EditorAction -= Control_EditorAction; } }
private void OnFocusChange(object sender, FocusChangeEventArgs e) { if (e.Active || !this.IsActive) { return; } //todo better sub + dispose ? this.IsActive = false; this.ValueChange?.Invoke(this, new KeyEventArgs(false, true)); }
private void ResponseToFocusChanged(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { this.Control.SetBackgroundColor(global::Android.Graphics.Color.LightBlue); _messagebus.Publish("CONTENT_SELECTED", this.Control.Text); } else { this.Control.SetBackgroundColor(global::Android.Graphics.Color.LightGray); } }
void CurrencyEditText_FocusChange(object sender, FocusChangeEventArgs e) { if (e.HasFocus) { this.FormatAsDecimal(); this.SetFilters(new IInputFilter[] { inputFilter }); } else { this.SetFilters(new IInputFilter[] { }); this.FormatAsCurrency(); } }
private void ViewOnFocusChange(object sender, FocusChangeEventArgs e) { if (_command == null) { return; } if (!_command.CanExecute(e.HasFocus)) { return; } _command.Execute(e.HasFocus); }
public void HighlightOff(object sender, FocusChangeEventArgs e) { if (HighlightEnabled && !e.Focused) { if (Shape != null) { Shape.FillColor = IdleBackgroundColor; } if (Text != null) { Text.Color = IdleTextColor; } } }
private void ControlOnFocusChange(object sender, FocusChangeEventArgs args) { if (args.HasFocus) { var manager = (InputMethodManager)Application.Context.GetSystemService(Context.InputMethodService); EditText.PostDelayed(() => { EditText.RequestFocus(); manager.ShowSoftInput(EditText, 0); }, 100); } // TODO : Florell, Chase (Contractor) 02/21/17 focus }
private void ControlOnFocusChange(object sender, FocusChangeEventArgs args) { _hasFocus = args.HasFocus; if (_hasFocus) { EditText.Post(() => { EditText.RequestFocus(); ShowKeyboardWithAnimation(); }); } else { //Hide the Keyboard mKeyboardView.Visibility = ViewStates.Gone; } }
private void ControlOnFocusChange(object sender, FocusChangeEventArgs args) { if (args.HasFocus) { var manager = (InputMethodManager)Application.Context.GetSystemService(Context.InputMethodService); EditText.PostDelayed(() => { EditText.RequestFocus(); manager.ShowSoftInput(EditText, 0); }, 100); } //var isFocusedPropertyKey = Element.GetInternalField<BindablePropertyKey>("IsFocusedPropertyKey"); //((IElementController)Element).SetValueFromRenderer(isFocusedPropertyKey, args.HasFocus); }
/// <summary> /// If an item has either been granted focus or lost it. /// </summary> /// <param name="obj">The object that fired the event.</param> /// <param name="e">The event arguments.</param> protected override void OnItemFocusChange(object obj, FocusChangeEventArgs e) { //Call the base method. base.OnItemFocusChange(obj, e); //The component. Component item = (Component)obj; //First, see if the component has gained focus. if (!item.HasFocus) { return; } //See to it that the items' drawing orders are evenly spaced. foreach (Component i in _Items) { i.DrawOrder = 1; } //Make sure that the item in focus gets drawn last. item.DrawOrder = 0; }
private void OnFocusChange(object sender, FocusChangeEventArgs focusChangeEventArgs) { }
/// <summary> /// A child component has had its focus change. /// </summary> /// <param name="obj">The object that fired the event.</param> /// <param name="e">The event's arguments.</param> protected virtual void OnItemFocusChange(object obj, FocusChangeEventArgs e) { }
/// <summary> /// An item has had its focus change. /// </summary> /// <param name="obj">The object that fired the event.</param> /// <param name="e">The event's arguments.</param> protected override void OnItemFocusChange(object obj, FocusChangeEventArgs e) { //Call the base method. base.OnItemFocusChange(obj, e); //Try. try { //If the list has lost focus but still is open, turn it off. if (!((List)e.Item).HasFocus && (_State == MenuState.Open)) { SwitchState(); } //If the list has gained focus but isn't open, turn it on. else if (((List)e.Item).HasFocus && (_State == MenuState.Closed)) { SwitchState(); } } catch { } }