Beispiel #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;
            }
        }
Beispiel #2
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);
                }
            }
        }
Beispiel #3
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;
                }
            }
        }