コード例 #1
0
        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();
            }
        }
コード例 #2
0
 private void ViewImpl_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (!e.HasFocus)
     {
         LostFocus?.Invoke();
     }
 }
コード例 #3
0
 void OnFocusedChange(object?sender, FocusChangeEventArgs e)
 {
     if (!e.HasFocus)
     {
         VirtualView?.Completed();
     }
 }
コード例 #4
0
 private void InstantAutoCompleteTextView_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ShowDropDown();
     }
 }
コード例 #5
0
 void OnPickerFocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ShowDatePicker();
     }
 }
コード例 #6
0
 private void Control_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (!e.HasFocus)
     {
         Control.SetSelection(0);
     }
 }
コード例 #7
0
ファイル: EntryHandler.Android.cs プロジェクト: hevey/maui
 // 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));
     }
 }
コード例 #8
0
ファイル: TTextField.cs プロジェクト: covertops69/telling
        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);
            }
        }
コード例 #9
0
        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();
            }
        }
コード例 #10
0
 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));
 }
コード例 #11
0
 private void HighlightOffIfLostFocus(object sender, FocusChangeEventArgs e)
 {
     if (!e.Focused)
     {
         HighlightOff(sender, null);
     }
 }
コード例 #12
0
 private void Picker_FocusChanged(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ShowDatePicker();
     }
 }
コード例 #13
0
 private void EditTextOccurrences_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ViewModel.SelectedEndOption = RecurrenceControlViewModel.EndOptions.Occurrences;
     }
 }
コード例 #14
0
 void Control_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ShowTimePicker();
     }
 }
コード例 #15
0
 private void AutoCompleteTextView_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (sender is AutoCompleteTextView && e.HasFocus && !_didShownDropDown && Control.Text.Length == 0)
     {
         _didShownDropDown = true;
         Control.ShowDropDown();
     }
 }
コード例 #16
0
        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));
        }
コード例 #17
0
 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");
     }
 }
コード例 #18
0
        /*
         * 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);
            }
        }
コード例 #19
0
 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);
     }
 }
コード例 #20
0
 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);
         }
     }
 }
コード例 #21
0
 void Control_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         ShowTimePicker();
         ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, true);
     }
     else
     {
         ElementController.SetValueFromRenderer(VisualElement.IsFocusedPropertyKey, false);
     }
 }
コード例 #22
0
 private void Control_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         Control.EditorAction -= Control_EditorAction;
         Control.EditorAction += Control_EditorAction;
     }
     else
     {
         Control.EditorAction -= Control_EditorAction;
     }
 }
コード例 #23
0
ファイル: MenuHoldKey.cs プロジェクト: vana41203/O9K
        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));
        }
コード例 #24
0
 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);
     }
 }
コード例 #25
0
 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);
     }
 }
コード例 #26
0
 void CurrencyEditText_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         this.FormatAsDecimal();
         this.SetFilters(new IInputFilter[] { inputFilter });
     }
     else
     {
         this.SetFilters(new IInputFilter[] { });
         this.FormatAsCurrency();
     }
 }
コード例 #27
0
        private void ViewOnFocusChange(object sender, FocusChangeEventArgs e)
        {
            if (_command == null)
            {
                return;
            }

            if (!_command.CanExecute(e.HasFocus))
            {
                return;
            }

            _command.Execute(e.HasFocus);
        }
コード例 #28
0
 public void HighlightOff(object sender, FocusChangeEventArgs e)
 {
     if (HighlightEnabled && !e.Focused)
     {
         if (Shape != null)
         {
             Shape.FillColor = IdleBackgroundColor;
         }
         if (Text != null)
         {
             Text.Color = IdleTextColor;
         }
     }
 }
コード例 #29
0
        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
        }
コード例 #30
0
ファイル: MyEntry2.cs プロジェクト: maexsp/CustomKeyboardDemo
 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;
     }
 }
コード例 #31
0
        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);
        }
コード例 #32
0
ファイル: Form.cs プロジェクト: LaudableBauble/Bedlam
        /// <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;
        }
コード例 #33
0
 void CurrencyEditText_FocusChange(object sender, FocusChangeEventArgs e)
 {
     if (e.HasFocus)
     {
         this.FormatAsDecimal();
         this.SetFilters(new IInputFilter[] { inputFilter });
     }
     else
     {
         this.SetFilters(new IInputFilter[] { });
         this.FormatAsCurrency();
     }
 }
コード例 #34
0
		private void OnFocusChange(object sender, FocusChangeEventArgs focusChangeEventArgs)
		{
			
		}
コード例 #35
0
ファイル: Component.cs プロジェクト: LaudableBauble/Bedlam
 /// <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)
 {
 }
コード例 #36
0
ファイル: MenuItem.cs プロジェクト: LaudableBauble/Bedlam
        /// <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 { }
        }