/* Updates both the IEntry.CursorPosition and IEntry.SelectionLength properties. */
        static void UpdateCursorSelection(AppCompatEditText editText, IEntry entry)
        {
            if (!entry.IsReadOnly)            // && editText.HasFocus)// || editText.RequestFocus()))//&& editText.RequestFocus())
            {
                if (!editText.HasFocus)
                {
                    editText.RequestFocus();
                }

                int start = GetSelectionStart(editText, entry);
                int end   = GetSelectionEnd(editText, entry, start);

                editText.SetSelection(start, end);
            }
        }
Esempio n. 2
0
        public static void UpdateText(this AppCompatEditText editText, IEditor editor)
        {
            string text = editor.Text;

            if (editText.Text == text)
            {
                return;
            }

            editText.Text = text;

            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            editText.SetSelection(text.Length);
        }
Esempio n. 3
0
        public static void UpdateText(this AppCompatEditText editText, IEditor editor)
        {
            editText.UpdateText(editor.Text);

            editText.SetSelection(editText.Text?.Length ?? 0);
        }