示例#1
0
        public static void ApplyTheme(IMaterialTextField textField, IMaterialEntryRenderer element)
        {
            if (element == null)
            {
                return;
            }

            if (textField.ActiveTextInputController == null)
            {
                return;
            }

            FilledTextFieldColorThemer.ApplySemanticColorScheme(textField.ColorScheme, (MTextInputControllerFilled)textField.ActiveTextInputController);

            var textColor         = MaterialColors.GetEntryTextColor(element.TextColor);
            var placeHolderColors = MaterialColors.GetPlaceHolderColor(element.PlaceholderColor, element.TextColor);
            var underlineColors   = MaterialColors.GetUnderlineColor(element.PlaceholderColor);

            textField.TextInput.TextColor = textColor;
            textField.ActiveTextInputController.InlinePlaceholderColor         = placeHolderColors.InlineColor;
            textField.ActiveTextInputController.FloatingPlaceholderNormalColor = placeHolderColors.InlineColor;
            textField.ActiveTextInputController.FloatingPlaceholderActiveColor = placeHolderColors.FloatingColor;

            // BackgroundColor
            textField.ActiveTextInputController.BorderFillColor = MaterialColors.CreateEntryFilledInputBackgroundColor(element.BackgroundColor, element.TextColor);

            textField.ActiveTextInputController.ActiveColor = underlineColors.FocusedColor;
            textField.ActiveTextInputController.NormalColor = underlineColors.UnFocusedColor;
        }
        protected virtual void ApplyTheme()
        {
            if (_activeTextinputController == null)
            {
                return;
            }

            FilledTextFieldColorThemer.ApplySemanticColorScheme(_colorScheme, (MTextInputControllerFilled)_activeTextinputController);
            OverrideThemeColors();
        }