Example #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);

            if (this.Control != null)
            {
                GradientDrawable gd = new GradientDrawable();
                gd.SetCornerRadius(10);
                gd.SetColor(Color.White.ToAndroid());
                this.Control.SetBackground(gd);
            }

            BaseEntry base_entry = (BaseEntry)this.Element;

            this.SetReturnType(base_entry);

            this.Control.EditorAction += (object sender, TextView.EditorActionEventArgs args) =>
            {
                if (base_entry.ReturnType != ReturnType.Next)
                {
                    base_entry.Unfocus();
                }

                base_entry.InvokeCompleted();
            };
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            base.OnElementChanged(e);

            BaseEntry entry = (BaseEntry)this.Element;

            if (this.Control != null)
            {
                Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);
                Control.SetHintTextColor(Color.FromHex("#B9B9B9").ToAndroid());
                Control.Gravity = GravityFlags.CenterVertical;
                //this.Control.SetRawInputType(InputTypes.TextFlagNoSuggestions);
                if (string.IsNullOrWhiteSpace(Control.Text))
                {
                    Control.SetCursorVisible(true);
                }
                if (entry != null)
                {
                    SetReturnType(entry);

                    // Editor Action is called when the return button is pressed
                    Control.EditorAction += (object sender, TextView.EditorActionEventArgs args) =>
                    {
                        if (entry.ReturnType != ReturnType.Next)
                        {
                            entry.Unfocus();
                        }

                        // Call all the methods attached to base_entry event handler Completed
                        entry.InvokeCompleted();
                    };
                }
            }
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
        {
            BaseEntry base_entry = (BaseEntry)this.Element;

            base.OnElementChanged(e);

            if (Control != null && base_entry != null)
            {
                SetReturnType(base_entry);

                // Editor Action is called when the return button is pressed
                Control.EditorAction += (object sender, TextView.EditorActionEventArgs args) =>
                {
                    if (base_entry.ReturnType != ReturnType.Next)
                    {
                        base_entry.Unfocus();
                    }

                    // Call all the methods attached to base_entry event handler Completed
                    base_entry.InvokeCompleted();
                };
            }
        }