ViewPump icon indicating copy to clipboard operation
ViewPump copied to clipboard

Change font fot EditText and TabLaout

Open goodibunakov opened this issue 6 years ago • 0 comments

I try this `public InflateResult intercept(@NotNull Chain chain) { InflateRequest request = chain.request(); InflateResult result = chain.proceed(request); if (applicationTheme != null) { View view = result.view(); if (view != null) { AttributeSet attrs = request.attrs(); if (view instanceof TextView || view instanceof Toolbar && !(view instanceof BottomAppBar)) setFont(view, applicationTheme.getFontName()); } return result; }

private void setFont(View view, String fontName) {

    if (fontName != null) {
        String formattedName = fontName.replaceAll("^\"|\"$", "").trim();
        typeface = getTypeface(formattedName, context);
    }
    if (typeface == null)
        typeface = ResourcesCompat.getFont(context, R.font.montserrat_medium);


    if (view instanceof TextView) {
        view.setTypeface(typeface);
    }
}`

This code don't change font for EditText (if inputtype="password") and for TabLayout. How i can intercept it?

goodibunakov avatar Jun 17 '19 06:06 goodibunakov