Esempio n. 1
0
        private void UpdateInputScope(InputScope inputScope)
        {
            if (_textBoxView != null)
            {
                var inputType = InputScopeHelper.ConvertInputScope(inputScope ?? InputScope);

                inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope ?? InputScope);

                if (!IsSpellCheckEnabled)
                {
                    inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck);
                }

                if (AcceptsReturn)
                {
                    inputType |= InputTypes.TextFlagMultiLine;
                }

                if (IsReadOnly)
                {
                    inputType = InputTypes.Null;
                }

                _textBoxView.InputType = inputType;
            }
        }
Esempio n. 2
0
        partial void OnInputScopeChangedPartial(DependencyPropertyChangedEventArgs e)
        {
            this.CoerceValue(ReturnKeyTypeProperty);

            if (_textBoxView != null)
            {
                _textBoxView.KeyboardType = InputScopeHelper.ConvertInputScopeToKeyboardType((InputScope)e.NewValue);

                //If SpellCheck is enabled we already set the Capitalization.
                if (!IsSpellCheckEnabled)
                {
                    _textBoxView.AutocapitalizationType = InputScopeHelper.ConvertInputScopeToCapitalization((InputScope)e.NewValue);
                }
            }
        }
Esempio n. 3
0
        private InputTypes AdjustInputTypes(InputTypes inputType, InputScope inputScope)
        {
            inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope);

            if (!IsSpellCheckEnabled)
            {
                inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck);
            }

            if (AcceptsReturn)
            {
                inputType |= InputTypes.TextFlagMultiLine;
            }

            return(inputType);
        }
Esempio n. 4
0
        private void UpdateInputScope(InputScope inputScope)
        {
            if (_textBoxView != null)
            {
                var inputType = InputScopeHelper.ConvertInputScope(inputScope);
                inputType = AdjustInputTypes(inputType, inputScope);

                if (FeatureConfiguration.TextBox.UseLegacyInputScope)
                {
                    _textBoxView.InputType = inputType;
                }
                else
                {
                    // InputScopes like multi-line works on Android only for InputType property, not SetRawInputType.
                    // For CurrencyAmount (and others), both works but there is a behavioral difference documented in UseLegacyInputScope.
                    // The behavior that matches UWP is achieved by SetRawInputType.
                    _textBoxView.InputType = AdjustInputTypes(InputTypes.ClassText, inputScope);
                    _textBoxView.SetRawInputType(inputType);
                }
            }
        }
Esempio n. 5
0
        private void UpdateInputScope(InputScope inputScope)
        {
            if (_textBoxView != null)
            {
                var inputType = InputScopeHelper.ConvertInputScope(inputScope ?? InputScope);

                inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope ?? InputScope);

                if (!IsSpellCheckEnabled)
                {
                    inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck);
                }

                if (AcceptsReturn)
                {
                    inputType |= InputTypes.TextFlagMultiLine;
                }

                if (IsReadOnly)
                {
                    _textBoxView.InputType = InputTypes.Null;

                    // Clear the listener so the inputs have no effect.
                    // Setting the input type to InputTypes.Null is not enough.
                    _listener = _textBoxView.KeyListener;
                    _textBoxView.KeyListener = null;
                }
                else
                {
                    if (_listener != null)
                    {
                        _textBoxView.KeyListener = _listener;
                    }

                    _textBoxView.InputType = inputType;
                }
            }
        }