コード例 #1
0
        protected override void OnAttached()
        {
            try
            {
                EditText editText;

                # region Material Design
                if (Control is TextInputLayout inputLayout)
                {
                    editText = inputLayout.EditText;
                }
                #endregion

                else if (Control is EditText text)
                {
                    editText = text;
                }
                else
                {
                    return;
                }

                editText.ShowSoftInputOnFocus = KeyboardEffect.GetEnableKeyboard(Element);

                if (!editText.ShowSoftInputOnFocus)
                {
                    editText.FocusChange += HideMethod;
                }

                var requestFocus = KeyboardEffect.GetRequestFocus(Element);
                if (requestFocus)
                {
                    editText.RequestFocus();
                }
            }
コード例 #2
0
        protected override void OnAttached()
        {
            try
            {
                if (!(Control is UITextField nativeTextField) || KeyboardEffect.GetEnableKeyboard(Element))
                {
                    return;
                }

                nativeTextField.InputView = new UIView();

                nativeTextField.InputAssistantItem.LeadingBarButtonGroups  = null;
                nativeTextField.InputAssistantItem.TrailingBarButtonGroups = null;

                var requestFocus = KeyboardEffect.GetRequestFocus(Element);
                if (requestFocus)
                {
                    nativeTextField.BecomeFirstResponder();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }
コード例 #3
0
        protected override void OnDetached()
        {
            try
            {
                if (!(Control is UITextField nativeTextField))
                {
                    return;
                }

                nativeTextField.InputView = null;
                var requestFocus = KeyboardEffect.GetRequestFocus(Element);
                if (requestFocus)
                {
                    nativeTextField.BecomeFirstResponder();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
            }
        }
コード例 #4
0
 public Task <Guid> CreateKeyboardEffectAsync <T>(KeyboardEffect effect, T data)
     where T : struct
 {
     Called?.Invoke(this, new MockCall(nameof(CreateKeyboardEffectAsync), data));
     return(Task.FromResult(Guid.NewGuid()));
 }
コード例 #5
0
 public Task <Guid> CreateKeyboardEffectAsync(KeyboardEffect effect)
 {
     throw new NotImplementedException();
 }