Esempio n. 1
0
        void UpdateFont()
        {
            var fontManager = MauiContext.Services.GetRequiredService <IFontManager>();
            var font        = Font.OfSize(_searchHandler.FontFamily, _searchHandler.FontSize).WithAttributes(_searchHandler.FontAttributes);

            _editText.Typeface = fontManager.GetTypeface(font);
            _editText.SetTextSize(ComplexUnitType.Sp, (float)_searchHandler.FontSize);
        }
    protected override TextInputLayout CreateNativeControl()
    {
        var textInputLayout = new TextInputLayout(Context);
        var editText        = new AppCompatEditText(Context);

        editText.SetTextSize(ComplexUnitType.Sp, (float)Element.FontSize);
        textInputLayout.AddView(editText);
        return(textInputLayout);
    }
Esempio n. 3
0
        public static void UpdateFont(this AppCompatEditText editText, IEntry entry, IFontManager fontManager)
        {
            var font = entry.Font;

            var tf = fontManager.GetTypeface(font);

            editText.Typeface = tf;

            var sp = fontManager.GetScaledPixel(font);

            editText.SetTextSize(ComplexUnitType.Sp, sp);
        }
        protected override TextInputLayout CreateNativeControl()
        {
            var textInputLayout = new TextInputLayout(Context);
            var editText        = new AppCompatEditText(Context)
            {
                SupportBackgroundTintList = ColorStateList.ValueOf(GetPlaceholderColor())
            };

            editText.SetTextSize(ComplexUnitType.Sp, (float)Element.FontSize);
            textInputLayout.AddView(editText);
            return(textInputLayout);
        }
Esempio n. 5
0
        public static void UpdateFont(this AppCompatEditText editText, IEditor editor, IFontManager fontManager)
        {
            var font = editor.Font;

            var tf = fontManager.GetTypeface(font);

            editText.Typeface = tf;

            var sp = fontManager.GetScaledPixel(font);

            editText.SetTextSize(Android.Util.ComplexUnitType.Sp, sp);
        }
        protected override TextInputLayout CreateNativeControl()
        {
            ////var layout = (TextInputLayout)LayoutInflater
            ////    .From(Context)
            ////    .Inflate(Resource.Layout.TextInputLayou, null);

            //return new TextInputLayout(Context);
            var textInputLayout = new TextInputLayout(Context);
            var editText        = new AppCompatEditText(Context)
            {
                SupportBackgroundTintList = ColorStateList.ValueOf(GetPlaceholderColor())
            };

            //Drawable TrailingIcon =
            //editText.SetCompoundDrawablesWithIntrinsicBounds()
            editText.SetTextSize(ComplexUnitType.Sp, (float)Element.FontSize);

            editText.InputType = Element.Keyboard.ToInputType();
            textInputLayout.AddView(editText);
            return(textInputLayout);
        }